📅  最后修改于: 2022-03-11 15:04:31.910000             🧑  作者: Mango
# .env files
API_URL=https://myapi.com
GOOGLE_MAPS_API_KEY=abcdefgh
# use env
import Config from 'react-native-config'
Config.API_URL // 'https://myapi.com'
Config.GOOGLE_MAPS_API_KEY // 'abcdefgh'
# call env
development: ENVFILE=.env.staging react-native run-android
production: cd android && ENVFILE=.env.production ./gradlew assembleRelease