react-native-dotenv icon indicating copy to clipboard operation
react-native-dotenv copied to clipboard

How to release a build for staging env

Open v4irajvimu opened this issue 2 years ago • 1 comments

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

v4irajvimu avatar Sep 18 '22 16:09 v4irajvimu

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

github-actions[bot] avatar Sep 18 '22 16:09 github-actions[bot]

take a look here https://github.com/goatandsheep/react-native-dotenv/wiki/Multi-env-troubleshooting#xcode

goatandsheep avatar Oct 13 '22 21:10 goatandsheep

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 avatar Apr 07 '23 04:04 felipejh

@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 avatar Dec 12 '23 06:12 badalsaibo

@badalsaibo did you fix this?

leofolive avatar Apr 03 '24 20:04 leofolive

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.

goatandsheep avatar Apr 03 '24 21:04 goatandsheep

@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

badalsaibo avatar Apr 04 '24 03:04 badalsaibo

@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.

leofolive avatar Apr 04 '24 12:04 leofolive