Is there any option available in the playstore console to configure this value?
Here is the official doc. code:
// Creates instance of the manager.
AppUpdateManager appUpdateManager = AppUpdateManagerFactory.create(context);
// Returns an intent object that you use to check for an update.
Task<AppUpdateInfo> appUpdateInfoTask = appUpdateManager.getAppUpdateInfo();
// Checks that the platform will allow the specified type of update.
appUpdateInfoTask.addOnSuccessListener(appUpdateInfo -> {
if (appUpdateInfo.updateAvailability() == UpdateAvailability.UPDATE_AVAILABLE
// For a flexible update, use AppUpdateType.FLEXIBLE
&& appUpdateInfo.isUpdateTypeAllowed(AppUpdateType.IMMEDIATE)) {
// Request the update.
}
});
How do we know about:
appUpdateInfo.isUpdateTypeAllowed(AppUpdateType.IMMEDIATE)
Where to configure the above type? There is no relevant description available on the official doc.
In the AppUpdateInfo.class:
public final boolean isUpdateTypeAllowed(int var1) {
if (var1 == 0) {
return this.f != null;
} else if (var1 == 1) {
return this.e != null;
} else {
return false;
}
}
Where f
and e
are the PendingIntent
and method returns true
or false
based on their value.
In-app updates is a Google Play Core libraries feature that prompts active users to update your app. The in-app updates feature is supported on devices running Android 5.0 (API level 21) or higher. Additionally, in-app updates are only supported for Android mobile devices, Android tablets, and Chrome OS devices.
To determine priority, Google Play uses an integer value between 0 and 5, with 0 being the default and 5 being the highest priority. To set the priority for an update, use the inAppUpdatePriority field under Edits.
What is the use of appUpdateInfo.isUpdateTypeAllowed(AppUpdateType.IMMEDIATE)?
This is a very common question.
Many (myself included) interpreted this as a value that could be set somewhere dynamically, e.g. in the Google Play Console.
However that appears to not be the case. This is a local check that determines whether conditions on the device have been met to show the dialog.
If you want to dynamically configure whether to show Immediate or Flexible updates, you will need to provide it yourself, e.g. from your backend.
For more info: https://medium.com/@jplipata/undocumented-android-in-app-updates-a95efb9b7bd8?source=friends_link&sk=e8085150daa555ea80d07e8419b5341e
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With