Satyam G
06/22/2022, 2:08 PMappUpdateManager.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 ?Landry Norris
06/22/2022, 7:16 PMresultLauncher
tseisel
06/22/2022, 7:54 PMActivityResultContract
that uses this API, unless one already exists.
Here is the official guide: https://developer.android.com/training/basics/intents/result#customIan Lake
06/23/2022, 4:45 AMstartUpdateFlowForResult
version that takes an Activity, nor should you be using the StartActivityForResult
contract for this API, which uses the IntentSender
APISatyam G
06/23/2022, 5:10 AM