Sivan
06/28/2023, 7:45 AMJakub Syty
06/28/2023, 8:23 AMSivan
06/28/2023, 8:42 AMSivan
06/28/2023, 8:49 AMImmediate
) based of a particular condition. All the releases that I create on play console
would be an "optional update"
but on the client side, I would want to trigger a forced update flow based on a condition.
Is this theoretically possible though? Something like this.
appUpdateInfoTask.addOnSuccessListener { appUpdateInfo ->
if (appUpdateInfo.updateAvailability() == UpdateAvailability.UPDATE_AVAILABLE) {
// Request the update.
if(shouldForceUpdateForTheUser) {
appUpdateManager.startUpdateFlowForResult(
appUpdateInfo,
activityResultLauncher,
AppUpdateOptions.newBuilder(AppUpdateType.IMMEDIATE).build()) // NOTE - I trigger a forced update
)
}
}
}
Jakub Syty
06/28/2023, 8:54 AMJakub Syty
06/28/2023, 8:55 AMJakub Syty
06/28/2023, 8:55 AMSivan
06/28/2023, 9:47 AMbut it won't force the user to update.it means that the update dialog/screen would be shown to the user and if they dont update, they are thrown outta the app right? They wouldnt be able to use the app like how you do with a flexible update.
Jakub Syty
06/28/2023, 9:49 AMJakub Syty
06/28/2023, 9:49 AMJakub Syty
06/28/2023, 9:50 AMSivan
06/28/2023, 10:15 AMif (resultCode == RESULT_CANCELED) {
// This block of code is executed if user clicks cancel button from the in-app update screen or press the hardware back button.
}