Show js bundle version in app
Paul Cowgill
I would like to show the js bundle version that is running in the app, probably somewhere in the settings section.
It would be helpful for users (and developers) to be able to confirm the app is running the JavaScript bundle that was most recently published using the exp CLI.
Is there a function or an API endpoint for accessing the js bundle version?
Junius Lekgwara
use const { revisionId, releaseChannel } = Expo.Constants.manifest;
see https://expo.io/@lekgwaraj/get-bundle-version
Sébastien Lorber
Check Expo.Constants.manifest
Abdiel Aviles
Sébastien Lorber: Which prop in the manifest would give this info? I checked and it's not evident.
Abdiel Aviles
So, we can use Constants.manifest.version and then edit the version in app.json
For example one could use a versioning strategy like
<major>.<minor>.<patch>-<build>-<bundle>
where
build
is the xCode build number, and bundle
is the expo publish number.I was not able to find any specifics inside manifest that would automatically generate a publish build number or id.