Read app.json (or exp.json) programmatically

Is there a way to read the contents app.jsonprogrammatically from your application so that you can, for example, get the current version number and display it on the About screen?

+10
source share
2 answers

You can access this through Expo.Constants.manifest - this includes the configuration of app.json without any potentially important information, such as API private keys.

import { Constants } from 'expo';
Constants.manifest.version // your app version
+30
source

For expo SDK 33 use:

 import Constants from "expo-constants";
 {'v${Constants.manifest.version}'}
0
source

Source: https://habr.com/ru/post/1682076/


All Articles