react-native-dotenv
react-native-dotenv copied to clipboard
How to release a build for staging env
Hi Team,
I have followed multiple env files in the app.
- .env.development
- .env.production
- .env-staging
I have set three different values for the API_BASE_URL since I need to connect to the backend according to the environment. currently working with debug mode by setting environment like this => APP_ENV=staging react-native start
My question is when I release a build using Xcode archive, how to set the .env.staging file values? it is always picking the .env.production values. I need to get a build that app connected to staging backend URL
Hey, thank you for opening this issue! 🙂 To boost priority on this issue and support open source please tip the team at https://issuehunt.io/r/goatandsheep/react-native-dotenv/issues/353
take a look here https://github.com/goatandsheep/react-native-dotenv/wiki/Multi-env-troubleshooting#xcode
take a look here https://github.com/goatandsheep/react-native-dotenv/wiki/Multi-env-troubleshooting#xcode
Sorry, but there is no information is not clear about how to run iOS in a staging
mode.
I've built in production
and debug
through Xcode. But I could not run in a staging
mode.
I created the schema for staging, selecting staging
for run
and archive
.
@felipejh Did you fix this? I need to create an archive in Xcode using the .env.development
file, but it always picks the .env
even in debug config
cc @goatandsheep
@badalsaibo did you fix this?
It is working for me for Android and iOS yes after extensive testing. I will need to overhaul the documentation but the rough docs are in wiki. I'm almost caught up. Should be on it this weekend.
@badalsaibo did you fix this?
I didn't. I have to manually change the .env contents for production and dev while creating archive for iOS
@goatandsheep The issue arises during the execution of a build in release mode on XCODE. Our objective is to have it use a designated .env file customized for release mode, rather than falling back to the default .env file. For instance, when building in release mode using .env.development, it consistently reverts to .env, causing complications in an application with multiple levels of testing in release mode.