react-nativeexpoexpo-go

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.


Solution

  • You can use Expo's AppOwnership from Constants

    import Constants from 'expo-constants'
    
    const isRunningInExpoGo = Constants.appOwnership === 'expo'
    

    source