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 AMImmediateplay console"optional update"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.
}