From where I can set app update type(IMMEDIATE/FLEXIBLE)? I can not find it in playstore console.
From where this code knowing available update type?
// Creates an 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.
}
});
We need to call this: PUT API
https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks/{track}
Pass data in body:
{
"releases": [{
"versionCodes": ["12"],
"inAppUpdatePriority": 5,
"status": "completed"
}]
}
To determine priority, Google Play uses an integer value between 0 and 5, with 0 being the default, and 5 being the highest priority. For example, consider the following strategy for setting update priority:
For Full info you can refer to below links:
https://developer.android.com/guide/playcore/in-app-updates#:~:text=In%2Dapp%20updates%20is%20a,0%20or%20higher.
https://developers.google.com/android-publisher/api-ref/rest/v3/edits.tracks/update
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