I'm trying to get the date time when I publish the app as the app version so I don't have to update the version manually. I'm defining the information in the 'extra' object
app.config.js
export default ({ config }) => {
config.extra = {
buildDate: new Date(),
};
return config;
};
and getting it via expo-constants
App.js
import Constants from 'expo-constants';
...
<Text muted>Build date time: {moment.utc(Constants.manifest.extra.buildDate).format('DD/MM/YYYY HH:mm UTC')}</Text>
...
However, when I open the app the value changes - turns out it runs again every time and is not related to publishing the app.
How to get this properly configured?