InAppUpdater
InAppUpdater copied to clipboard
[BUG] force update closing on back button.
Describe the bug force update is closing when hardware back button is pressed. To Reproduce Steps to reproduce the behavior:
- trigger force update
- Click on back button
- force update window closes.
Expected behavior force update is needed so that old version are updated forcefully. user can still close the window and use old version.
Additional context my main activity has onBackPress() which helps user to exit app for twice clicks.
You have to handle that in the onActivityResult method of your activity, that can't be controlled in the library.
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
when (requestCode) {
UpdateManagerConstant.REQUEST_CODE -> {
when(resultCode){
Activity.RESULT_OK -> {
}
Activity.RESULT_CANCELED -> {
if(updateMgr?.mode == UpdateManagerConstant.IMMEDIATE) finish()
}
ActivityResult.RESULT_IN_APP_UPDATE_FAILED -> {
}
}
}
}
}
UpdateManagerConstant.REQUEST_CODE accessing this from the library it shows package private is not accessible.
Unable to register updatemanger For Activity Result, moreover onActivityResult is deprecated now.