We use firebase (cloud functions, cloud firestore, etc.) as backend. When a user launches our mobile app (iOS or Android) we want to compare the user's currently installed version against a recommended minimal version that we define and display an alert to the user when his installed version is lower than the recommended one. E.g. when we publish important new mobile app features on the App Store / Play Store we want users that have installed a lower version to be notified within the app to update the app.
Note: The recommended version number not necessarily is the latest available version, e.g. the latest version could only have minor updates compared to the recommended one so it could be ok to have at least the recommended version installed, but not necessarily the latest one.
How would you typically implement this from a software and economic point of view:
- Have a firebase function that accepts the user's current version and platform (iOS, Android) as parameters and which compares the data to a hard coded version in the function (cons: you have to update the function everytime you have a new app version you want to alert about).
- Store the current version in a simple firestore document and just query the document and do the comparison on the client side (cons: it's not code managed, you update the database instead of updating your code).
- Or other solutions such as using a simple website as described here Check if my app has a new version on AppStore.