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?
app. json is a manifest format for describing web apps. It declares environment variables, add-ons, and other information required to run an app on Heroku. This document describes the schema in detail.
Because native code can be difficult to maintain, this new script allows an app. json to be defined for the project, which is used to configure the native app.
config. js, app. config. ts) is used for configuring how a project loads in Expo Go, Expo Prebuild generation, and the OTA update manifest.
You can access this through Constants.manifest
. This includes your app.json config without any of the potentially sensitive information such as API secret keys.
import Constants from 'expo-constants';
Constants.manifest.version
For Expo SDK 35, I did this:
expo install expo-constants
in your .js:
import Constants from "expo-constants";
<Text> {Constants.manifest.description} </Text>
For expo SDK 33 use:
import Constants from "expo-constants";
{`v${Constants.manifest.version}`}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With