I use expo-analytics-amplitude to track the version number of the builds (apk or ipa) but I would like to track the version of the OTA Expo update instead (as it is more often what we do). Any solution?
Hi @mahfoudsam, I found your question since I want to do the same thing.
Unfortunately I looked through the code and docs for expo-analytics-amplitude
as well as the native & web Amplitude SDK’s.
Quick definition: “version number” in Amplitude is called “version name”.
Whereas for the Amplitude JS SDK, you can set the version name (see https://github.com/amplitude/Amplitude-Javascript/blob/master/src/amplitude-client.js#L1085)
In the Android and iOS SDKs, the version name is read directly from the device, and the SDK doesn’t provide a way to set it. See https://github.com/amplitude/Amplitude-Android/blob/master/src/main/java/com/amplitude/api/AmplitudeClient.java#L1003
Sad but true…
So the solution for the near term, until expo-analytics-amplitude
somehow merges with the JS version of the Amplitude SDK, is to set a custom user property, e.g. “OTA-version”
That’s what I’m going to do anyway.
Amplitude.setUserProperties({ otaVersion: Constants.manifest.version });
Thanks for the reply @guitarmasteryintensi. I agree, that should be the best solution for now (although it would be trickier for ejected apps - at least for now)