react-nativeexpo

Read app.json (or exp.json) programmatically


Is there a way to read the contents of app.json programmatically from within you app, so you could for example get the current version number and show it within an About screen?


Solution

  • Constants.manifest got deprecated now, you can access this through Constants.expoConfig. This includes your app.json config without any of the potentially sensitive information such as API secret keys.

    import Constants from 'expo-constants';
    Constants.expoConfig.version