Reputation: 16572
Recently while browsing Hotstar Android app and I got a pop up in it that said I need to update the application to the latest. So, I clicked on this update button and I saw that Google's In-App update API has launched so I tried to look for some or the other documentation related to it and could not find anything, has anyone already implemented this? Can someone point me in the right direction?
I have already checked the following:
https://developers.google.com/android/work/play/emm-api/update
https://www.quora.com/Is-there-an-API-for-the-Google-Play-Store
Upvotes: 0
Views: 1224
Reputation: 20734
Check these docs to support in-app updates.
To check if an update is available for your app:
AppUpdateManager appUpdateManager = AppUpdateManagerFactory.create(context);
Task<AppUpdateInfo> appUpdateInfoTask = appUpdateManager.getAppUpdateInfo();
appUpdateInfoTask.addOnSuccessListener(appUpdateInfo -> {
if (appUpdateInfo.updateAvailability() == UpdateAvailability.UPDATE_AVAILABLE
&& appUpdateInfo.isUpdateTypeAllowed(AppUpdateType.IMMEDIATE)) {
// Request the update.
}
});
Upvotes: 2