Search code examples
androidgoogle-playgoogle-play-servicesin-app-update

Suggest users to update Android app with Google Play (Google In-App Update Support)


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

enter image description here

The dialog gives me two methods to update the app:

  • Update now
  • Update when Wi-Fi available

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:

enter image description here

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?


Solution

  • 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