por*_*ors 10 react-native expo expo-go
我想在 React Native 代码中确定该应用程序是在 Expo Go 中运行还是作为独立的 iOS/Android 应用程序运行。
\n我可以\xe2\x80\x99t 使用__DEV__,因为我希望能够为生产版本确定这一点。
Rya*_*erg 21
您可以使用 ExpoAppOwnership的Constants
import Constants from 'expo-constants'
const isRunningInExpoGo = Constants.appOwnership === 'expo'
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4005 次 |
| 最近记录: |