expo-constants
provides system information that remains constant throughout the lifetime of your app's install.Android Device | Android Emulator | iOS Device | iOS Simulator | Web |
---|---|---|---|---|
→
expo install expo-constants
If you're installing this in a bare React Native app, you should also follow these additional installation instructions.
import Constants from 'expo-constants';
expo
, standalone
, or guest
. This property only applies to the managed workflow and classic builds; for apps built with EAS Build and in bare workflow, the result is always null
.expo
: The experience is running inside of the Expo Go app.standalone
: It is a standalone app.guest
: It has been opened through a link from a standalone app.fetch
requests.⚠️This property is deprecated and will be removed in SDK 44. Please implement it on your own usingexpo-application
'sandroidId
on Android and a storage API such asexpo-secure-store
on iOS andlocalStorage
on Web.
true
if the app is running on a device, false
if running in a simulator or emulator.CFBundleShortVersionString
on iOS and the version name set by version
in app.json on Android at the time the native app was built.CFBundleVersion
on iOS (set with ios.buildNumber
value in app.json in a standalone app) and the version code set by android.versionCode
in app.json on Android at the time the native app was built.ios
buildNumber
CFBundleVersion
in this app.
In a standalone app, you can set this with the ios.buildNumber
value in app.json. This
may differ from the value in Constants.manifest.ios.buildNumber
because the manifest
can be updated, whereas this value will never change for a given native binary.
The value is set to null
in case you run your app in Expo Go.platform
iPhone1,1
.model
"iPhone 7 Plus"
if it can be determined, otherwise will be null
.userInterfaceIdiom
handset
and tablet
. Apple TV and CarPlay will show up as unsupported
.systemVersion
10.3
.android
versionCode
android.versionCode
in app.json.
The value is set to null
in case you run your app in Expo Go.