I would like to determine in react native code if the app is running in Expo Go or as a stand-alone iOS/Android app.
I can’t use __DEV__
, because I would like to be able to determine this also for a production build.
I would like to determine in react native code if the app is running in Expo Go or as a stand-alone iOS/Android app.
I can’t use __DEV__
, because I would like to be able to determine this also for a production build.
You can use Expo's AppOwnership
from Constants
import Constants from 'expo-constants'
const isRunningInExpoGo = Constants.appOwnership === 'expo'
Since classic builds are now deprecated and everyone will start using EAS Builds
, you will need to use Constants.ExecutionEnvironment
instead of appOwnership
which is always null
in builds done via EAS
.
So you could use the following to check if in production:
ExecutionEnvironment.Standalone === "standalone"
Documentation can be found here