app.json fields seem to always be at last published versions instead of being built into the bundle
See original GitHub issueIn my app, I show the current version/build number as a tool to check that I’ve uploaded the right thing into the App Store.
I query the app build number with this code:
const { version } = Expo.Constants.manifest
const { buildNumber } = Expo.Constants.manifest.ios
Now that I’ve uploaded multiple versions of my app to the App Store, I notice that each version (obviously with different build #) in fact all show that they’d all be whatever is the most recent version published with exp.
As I specified isRemoteJSEnabled:false
, I expected this information to be also built into app bundle.
Environment
Environment: OS: macOS High Sierra 10.13.3 Node: 9.5.0 Yarn: 1.3.2 npm: 5.6.0 Watchman: Not Found Xcode: Xcode 9.2 Build version 9C40b Android Studio: Not Found
Packages: (wanted => installed) expo: ^25.0.0 => 25.0.0 react: 16.2.0 => Not Found react-native: 0.52.0 => 0.52.0
Diagnostics report: https://exp-xde-diagnostics.s3.amazonaws.com/nurpax-98d99231-de75-4126-932e-d21a354a0376.tar.gz
Targeting iOS, standalone app on app store.
Steps to Reproduce
(Write your steps here:)
- Write an app with version 1.0.0 with build #1. Specify
isRemoteJSEnabled:false
in app.json. - In the app, display the version number and build # by reading Expo.Constants.manifest
- exp publish and exp build:ios the app, upload to the App Store.
- Bump up the build number to #2.
- exp publish and exp build:ios the app, upload to the App Store.
When loading different versions of the app with TestFlight, both app build versions will report being at build #2. Even though I’d expect the TestFlight build #1 to show whatever version number it was built with.
Expected Behavior
I totally expected that with isRemoteJSEnabled:false
any metadata that I specifify in app.json would be built into the app bundle that I upload to the app store.
If I have uploaded build #1 to the App Store, and submitted it to the Application review, I would expect it to not change in anyway while I upload newer versions to the App Store for testing via TestFlight.
Actual Behavior
When I install an older build via TestFlight, it’s values in Expo.Constants.manifest change to whatever was previously published with exp. I would expect the old builds on the app store to stay the same regardless of what new versions I upload later.
Reproducible Demo
Making a repro case should be as easy as:
- make new project with CRNA
- upload multiple different builds on the app store
- run each different version using TestFlight and observe the value of the version and build number.
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (1 by maintainers)
Hi, you should use
Constants.platform.ios.buildNumber
, which will always read the embeddedCFBundleVersion
fromInfo.plist
.@nurpax @msevestre It sounds like a misunderstanding of how publishing and releasing on expo works. By default, when you run
exp build:ios
orexp build:android
, it first runsexp publish
behind the scenes. This pushes a new build to Expo’s server, allowing that version to be available immediately to users via Over the Air Updates. You can read more about it here: https://docs.expo.io/versions/latest/guides/configuring-ota-updatesI also disliked the idea of new versions automatically being pushed to end users, so I’ve disabled automatic updates and I now import the
Updates
module so I can still get Over the Air updates when running the app in “staging” mode, eg in TestFlight and Internal Tests. When I build the app for production, I pass--release-channel=production
, which creates a build without over the air updates that get’s downloaded by end users. This is great because we can iterate on a release with test users without having to build and push to the App/Play Store on each change, but still require users to download the final release version so that updates are predictable for users.