Reputation: 71
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.
}
});
Upvotes: 7
Views: 1624
Reputation: 17208
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://developers.google.com/android-publisher/api-ref/rest/v3/edits.tracks/update
Upvotes: 1