An API that provides system information that remains constant throughout the lifetime of your app's installation.
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 |
---|---|---|---|---|
-
npx 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';
AndroidManifest
AndroidManifest Properties
Name | Type | Description |
---|---|---|
versionCode | number |
The version code set by |
IOSManifest
IOSManifest Properties
Name | Type | Description |
---|---|---|
buildNumber | null | string | The build number specified in the embedded Info.plist value for |
model | null | string |
The human-readable model name of this device, e.g. |
platform | string |
The Apple internal model identifier for this device, e.g. |
systemVersion | string |
The version of iOS running on this device, e.g. |
userInterfaceIdiom | UserInterfaceIdiom |
The user interface idiom of this device, i.e. whether the app is running on an iPhone or an iPad. |
NativeConstants
NativeConstants Properties
Name | Type | Description |
---|---|---|
appOwnership | null | AppOwnership | Returns |
debugMode | boolean | - |
deviceName (optional) | string | A human-readable name for the device type. |
deviceYearClass | null | number |
The device year class of this device. |
executionEnvironment | ExecutionEnvironment | - |
experienceUrl | string | - |
expoConfig | null | ExpoConfig | The standard Expo config object defined in |
expoRuntimeVersion | null | string | - |
expoVersion | null | string | The version string of the Expo Go app currently running.
Returns |
getWebViewUserAgentAsync | () => Promise<null | string> | - |
installationId | string |
An identifier that is unique to this particular device and whose lifetime is at least as long as the installation of the app. |
intentUri (optional) | string | - |
isDetached (optional) | boolean | - |
isDevice | boolean |
|
isHeadless | boolean | - |
linkingUri | string | - |
manifest | null | AppManifest | Classic manifest for Expo apps using classic updates and the updates embedded in builds.
Returns
|
manifest2 | null | Manifest | Manifest for Expo apps using modern Expo Updates from a remote source, such as apps that
use EAS Update. Returns
|
nativeAppVersion | null | string |
The Info.plist value for |
nativeBuildVersion | null | string |
The Info.plist value for |
platform (optional) | PlatformManifest | - |
sessionId | string | A string that is unique to the current session of your app. It is different across apps and across multiple launches of the same app. |
statusBarHeight | number | The default status bar height for the device. Does not factor in changes when location tracking is in use or a phone call is active. |
systemFonts | string[] | A list of the system font names available on the current device. |
systemVersion (optional) | number | - |
PlatformManifest
PlatformManifest Properties
Name | Type | Description |
---|---|---|
android (optional) | AndroidManifest | - |
detach (optional) | {
scheme: string
} | - |
developer (optional) | string | - |
hostUri (optional) | string | - |
ios (optional) | IOSManifest | - |
logUrl (optional) | string | - |
scheme (optional) | string | - |
web (optional) | WebManifest | - |
AppManifest
Literal Type: multiple types
Represents an intersection of all possible Config types.
Acceptable values are: ExpoClientConfig
ExpoGoConfig
EASConfig
ClientScopingConfig
Record<string, any>
ClientScopingConfig
Name | Type | Description |
---|---|---|
scopeKey (optional) | string | An opaque unique string for scoping client-side data to this project. This value will not change when a project is transferred between accounts or renamed. |
EASConfig
Name | Type | Description |
---|---|---|
projectId (optional) | string | The ID for this project if it's using EAS. UUID. This value will not change when a project is transferred between accounts or renamed. |
ExpoClientConfig
ExpoConfig
extended by:
Name | Type | Description |
---|---|---|
bundleUrl | string | - |
currentFullName (optional) | string | The Expo account name and slug used for display purposes. Formatted like |
hostUri (optional) | string | - |
id (optional) | string |
The Expo account name and slug for this project. |
originalFullName (optional) | string | The original Expo account name and slug for this project. Formatted like |
publishedTime (optional) | string | - |
releaseChannel (optional) | string | - |
releaseId (optional) | string | Published apps only. |
revisionId (optional) | string | - |
ExpoGoConfig
Name | Type | Description |
---|---|---|
debuggerHost (optional) | string | - |
developer (optional) | {
tool: string
} | - |
logUrl (optional) | string | - |
mainModuleName (optional) | string | - |
packagerOpts (optional) | ExpoGoPackagerOpts | - |
ExpoGoPackagerOpts
Name | Type | Description |
---|---|---|
dev (optional) | boolean | - |
hostType (optional) | string | - |
lanType (optional) | string | - |
minify (optional) | boolean | - |
strict (optional) | boolean | - |
urlRandomness (optional) | string | - |
urlType (optional) | string | - |
key (index signature) | string | - |
Manifest
A modern manifest.
Name | Type | Description |
---|---|---|
assets | ManifestAsset[] | - |
createdAt | string | - |
extra (optional) | ManifestExtra | - |
id | string | - |
launchAsset | ManifestAsset | - |
metadata | object | - |
runtimeVersion | string | - |
ManifestExtra
ClientScopingConfig
extended by:
Name | Type | Description |
---|---|---|
eas (optional) | EASConfig | - |
expoClient (optional) | ExpoConfig & {
hostUri: string
} | - |
expoGo (optional) | ExpoGoConfig | - |
AppOwnership
AppOwnership Values
ExecutionEnvironment
ExecutionEnvironment Values
Bare
ExecutionEnvironment.Bare = "bare"
Standalone
ExecutionEnvironment.Standalone = "standalone"
StoreClient
ExecutionEnvironment.StoreClient = "storeClient"
UserInterfaceIdiom
Current supported values are handset
and tablet
. Apple TV and CarPlay will show up
as unsupported
.
UserInterfaceIdiom Values
Handset
UserInterfaceIdiom.Handset = "handset"
Tablet
UserInterfaceIdiom.Tablet = "tablet"
Unsupported
UserInterfaceIdiom.Unsupported = "unsupported"