简体   繁体   中英

How to check if installed version of app has become obsolete

PROBLEM

I want to make sure that user of my app is not using a really old version of my app. Just like it happens in WhatsApp that if you are using an outdated version it shows a message that current version has become obsolete, update your app from playstore. I want to achieve this kind of behavior in my app too.

Way I thought to achieve this

To achieve this behavior I thought of hitting a web service at start of app which will give latest version number of app available in response. That version number will be updated manually in backend on new update release, and in app I will get the current installed version of my app through code(if possible) and compare it with the version returned from web service. Web service will also return minimum install version required. So comparing with it I will show user dialog for updating app from play store.

This is what I thought to achieve this behavior. I want to know if this is correct way of doing this and if not please suggest me more appropriate way of achieving this behavior. Thanks

Yes, this is the correct approach.

If your app is using a web service, but not for everything, you can consider to only show the dialog if the service needs top be used. This minimizes the number of unnessecary requests to the server.

Normal is: Client sends request and own version number. Server checks version number. If it is recent enough, it handles the request, otherwise returns an OUTDATED response: If the client receives this OUTDATED response it can show a dialog and redirect to play store.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM