How to force update in Android application if new version is available?

后端 未结 6 459
小蘑菇
小蘑菇 2021-01-03 12:56

I am working on an application I want to give force update to app users if new version available on play store, the app should show a dialog message to user.

6条回答
  •  一生所求
    2021-01-03 13:38

    Recently google announces the official way of doing this thing with the help of play core library provided by google.

    There are two types of updates available - immediate update and flexible update. There are certain steps developer needs to follow for integrating the force update into his/her project.

    1. Check for update availability.
    2. Start an update
    3. Get a callback for update status
    4. Handle a flexible update
    5. Install a flexible update
    6. Handle an immediate update

    There are some chances when user killed the application during update so developer needs to handle this case also which are mentioned in steps no 4 and 6.

    Here is the link with the brief documentation and guide to integrate this in your project. Force update provided by google.

    Happy coding ..

提交回复
热议问题