App registration issue in 5.2
CompletedHi, Currently I am working on an Android project using DJI MSDK 5.2 from scratch. In the viewmodel I am using the below code to initialize and register
This works perfectly when I run the application for the first time in DJI RC+ of m30 series. But after exiting the app by pressing the back button and coming back again it doesn't get registered at all.
Every time I need to remove the application from the recent application stack to make it work again. Can anyone tell me any workaround solution for this?
Thanks
SDKManager.getInstance().init(context, object : SDKManagerCallback {
override fun onRegisterSuccess() {
Timber.d("registration success")
_regStatus.value = Status.Success(true)
}
override fun onRegisterFailure(error: IDJIError?) {
Timber.d("registration failed")
_regStatus.value = Status.Error(error.toString())
}
override fun onProductDisconnect(productId: Int) {
Timber.d("product $productId disconnected")
}
override fun onProductConnect(productId: Int) {
Timber.d("product $productId connected")
}
override fun onProductChanged(productId: Int) {
Timber.d("product changed to $productId")
}
override fun onInitProcess(event: DJISDKInitEvent?, totalProcess: Int) {
Timber.d( "InitProcess")
if (event == DJISDKInitEvent.INITIALIZE_COMPLETE) {
Timber.d("start registerapp")
SDKManager.getInstance().registerApp()
}
}
override fun onDatabaseDownloadProgress(current: Long, total: Long) {
Timber.d("myApp onDatabaseDownloadProgress ")
}
})
Please sign in to leave a comment.
Comments
2 comments