Does anybody know how to initialize the client SDK on Android not on main thread?
The issue is that
has to be called on main thread or it will throw:
java.lang.IllegalStateException: Method addObserver must be called on the main thread at androidx.lifecycle.LifecycleRegistry.enforceMainThreadIfNeeded(LifecycleRegistry.java:317) at androidx.lifecycle.LifecycleRegistry.addObserver(LifecycleRegistry.java:172) at com.airwatch.sdk.SDKManager.attachLaunchEventCallback(SDKManager.java:297) at com.airwatch.sdk.SDKManager.initOperationalDataReporting(SDKManager.java:289) at com.airwatch.sdk.SDKManager.<init>(SDKManager.java:258) at com.airwatch.sdk.SDKManager.getInstance(SDKManager.java:552) at com.airwatch.sdk.SDKManager.init(SDKManager.java:277)
and this method call has a 30 second timeout that blocks the main thread when there is an issue connecting the the airwatch agent service.
The docs show a call to init from a thread but clearly this does not work because of the above error: