Erwin Pandawa5
06/23/2022, 1:34 AMappUpdateManager.startUpdateFlowForResult(
info,
AppUpdateType.IMMEDIATE,
parentActivity,
MY_REQUEST_CODE
)
Which triggers the Immediate flow. If you observe here we are passing here the MY_REQUEST_CODE while triggering Update.
Once the update is Finished, Cancel we get the callback in OnActivityResult based on that we can take decisions. But we already know onActivityResult is deprecated now and it is recommended to use the Activity Result Api which has a code like
var resultLauncher =
registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { result ->
if (result.resultCode == Activity.RESULT_OK) {
// There are no request codes
val data: Intent? = result.data
inAppUpdate?.let {
inAppUpdate?.onActivityResult(result.resultCode, data)
}
} else if (result.resultCode == AppCompatActivity.RESULT_CANCELED) {
finish()
}
}
But How to get the request code in this case ???
Can anyone help here ?
Thread in #android