I have an app that uses Firebase Realtime DB. The app just receives text from the database and displays it on the screen.When i release a newer version,how can i make the previous version stop working and how can i force the users to update?

- 565,676
- 79
- 828
- 807

- 157
- 2
- 11
-
2Does this answer your question? [Force update of an Android app when a new version is available](https://stackoverflow.com/questions/19244305/force-update-of-an-android-app-when-a-new-version-is-available) – Reece Trolley May 08 '20 at 20:24
3 Answers
You should have considered this before publishing your app. Right now it's too late for that version, but make sure before publishing your new one that you have control over things like force update
or support push notifications
to suggest that a new update is live.
Keep something in mind though, that deprecating your old version is a bad practice and provides a bad user experience and you should not do that at all unless you have a major migration in the app that requires you to do so.

- 2,037
- 1
- 14
- 22
-
How can i trigger the force update or recommend to update from Firebase as a newer version is out(given that the previous version has the code to force update or recommend to update)?? – Poison_Frog May 08 '20 at 20:39
-
you should implement this in your app. Either send the version code to your backend everytime the user runs the app or use Google's in-app update https://developer.android.com/guide/playcore/in-app-updates – Alan Deep May 08 '20 at 23:38
You can't block user from using previous version. but you can build an api. in that api you declare latest version of app, and check it with current version inside app. if latest version > current app version, so user is using previous, you can show a dialog to update app (with setCancelable(false) to prevent using app).
OR
you can check current version with latest release in google play and do the same.

- 579
- 9
- 16
I would set up a node in your DB which tells the app which Build version the app has. I would post code but I don't have time at the moment but here is a Scheme:
Firebase Realtime Database: + App_Versions/Android/allowedversion = 25 (your current app version)
In the app, make sure that your appVersion meets the qualifications read from the database. If criteria met: Show texts, else: Do not show text.
Sorry for the text version of explaining!

- 59
- 4
-
This way, if the user has not updated to version 25, they will not receive information from the database, as they must be on the current "allowedVersion (25)" – cgreendyk104 May 08 '20 at 20:28
-
i get the point..the method is pretty simple as compared to the others out there....but in the dialogue that appears if the app is out of date, Suppouse i have a update button, how can i put my Playstore url in its code (through another node in my Firebase database) so that on clicking it the user is taken to the playstore so that they can update the app??Im not sure if i can retrieve the url on a string and then use the string as a url......hope you get the point – Poison_Frog May 08 '20 at 22:49