Hello, i’m writing an application with reactNative. Trying to display the app version on the one of my screens however the version is wrong. In my app.json its ‘1.0.0’ but when i use the constant ‘Application.nativeApplicationVersion’ it gives me 2.17.2? any help is appreciated!
-also if anyone has any ideas to change the ‘App Version: xxx’ render to maybe like a smaller font please do comment!
This is my app.json
"expo": {
"name": "Fault Report",
"slug": "FaultReport",
"platforms":
[
"ios",
"android"
],
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": [
"**/*"
],
"ios": {
"bundleIdentifier": "com.jjCob.BCHapp"
},
"android": {
"package": "com.jjCob.BCHapp",
"versionCode": 1
}
}
}
Here’s where I want to render the version number
function MainStackNavigator() {
let buildVersion = Application.nativeApplicationVersion;
console.log(Application.nativeApplicationVersion)
return (
<NavigationContainer >
<Stack.Navigator>
<Stack.Screen options={{headerShown: false}} name='Splash' component={Splash} />
<Stack.Screen name='Home' component={Home} options={{title: 'Scan QR/ ' +'App Version: ' + buildVersion}}/>
...
..
.