I saw this dialog always appears when I open old version of Tokopedia app. Tokopedia suggests me to update the app.

The dialog gives me two methods to update the app:
If I select Lain Kali (Cancel), the dialog appears again on the next app open. But, if I select the second option, I open Play Store and see this behavior:

It really do update on background until my device is connected to Wi-Fi.
I want to mimic the same action like Tokopedia did, because some version of my app contains critical bug. I want to give users a better user experience.
Do you know how to show the dialog above?
This is possible using In-App Update provided by Google.
In-app updates works only with devices running Android 5.0 (API level 21) or higher, and requires you to use Play Core library 1.5.0 or higher. There are two types - 1.Flexible and 2. Immediate.
Follow this link and implement In-App Update as per your requirement.
https://developer.android.com/guide/app-bundle/in-app-updates
You can achieve this by using Support in-app updates
It only work from Android 5.0 (API level 21) or higher.
There are two types of Update Available with UX for in-app updates:
To Check for update availability
// 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.
}
});
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