Expo

Get Started
API Reference

Constants

expo-constants provides system information that remains constant throughout the lifetime of your app's install.

Platform Compatibility

Android DeviceAndroid EmulatoriOS DeviceiOS SimulatorWeb

Installation

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';

Returns expo, standalone, or guest. This property only applies to the managed workflow; in bare, 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.

A human-readable name for the device type.

The device year class of this device.

The version string of the Expo Go app currently running.

Gets the user agent string which would be included in requests sent by a web view running on this device. This is probably not the same user agent you might be providing in your JS fetch requests.

⚠️
This property is deprecated and will be removed in SDK 44. Please implement it on your own using expo-application's androidId on Android and a storage API such as expo-secure-store on iOS and localStorage on Web.
An identifier that is unique to this particular device and whose lifetime is at least as long as the installation of the app.

true if the app is running on a device, false if running in a simulator or emulator.

The manifest object for the app.

The Info.plist value for CFBundleShortVersionString on iOS and the version name set by version in app.json on Android at the time the native app was built.

The Info.plist value for 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
      The build number specified in the embedded Info.plist value for 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
      The Apple internal model identifier for this device, e.g. iPhone1,1.
    • model
    The human-readable model name of this device, e.g. "iPhone 7 Plus" if it can be determined, otherwise will be null.
    • userInterfaceIdiom
    The user interface idiom of this device, i.e. whether the app is running on an iPhone or an iPad. Current supported values are handset and tablet. Apple TV and CarPlay will show up as unsupported.
    • systemVersion
    The version of iOS running on this device, e.g. 10.3.
  • android
    • versionCode
      The version code set by android.versionCode in app.json. The value is set to null in case you run your app in Expo Go.

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.

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.

A list of the system font names available on the current device.