How to get a versionName in react-native app on Android?
I've successfully used the React Native Device Info component to get the build details as specified in the Gradle config.
Once installed you can use:
DeviceInfo.getVersion()
To output the version, and:
DeviceInfo.getBuildNumber()
To get the build number.
If you want the version number in your package.json, you can also do:
var pkg = require('./package.json');
console.log(pkg.version);