Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Determine in code if app runs in Expo Go or not (in 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.

like image 973
pors Avatar asked Dec 21 '25 02:12

pors


2 Answers

You can use Expo's AppOwnership from Constants

import Constants from 'expo-constants'

const isRunningInExpoGo = Constants.appOwnership === 'expo'

source

like image 146
Ryan Soderberg Avatar answered Dec 23 '25 23:12

Ryan Soderberg


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

like image 36
Eduard Avatar answered Dec 24 '25 01:12

Eduard



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!