Constants.manifest.version
gives me the app version. Is there any way to see the version a user installed or would I need to store it somewhere like db and then always fetch from db and compare it with the version to know if user has an older version installed?
EDIT: What I am trying to do:
If there was an update, I want to be able to sometimes show a pop up to users that tells them there was an update and potentionally in very few cases i want to then force the user to upgrade. So for that I would need to compare the version the user has installed with the version in the app store/google play and if users version is lower, I send the popup. I would also have some logic to determine if its only a update recommendation or force update. Not sure yet how, but maybe another entry in the db for each version and boolean with boolean forceUpgrade/recommendedUpgrade
I'm handling version based updates manually, using AsyncStorage and two global constants:
Upon mount, extract storedAppVersion from AsyncStorage. Compare storedAppVersion with hardcoded CURRENT_APP_VERSION, and if there's a change, and if hardcoded RESET_ON_VERSION_CHANGE is true, forceUpdate!
Update occurs
after update, store CURRENT_APP_VERSION for subsequent versions (ie. .then() or button press).