Member-only story
Setup Environment (Debug , Staging , Production) in ReactNative iOS Application
In this article we will see how to setup debug
, staging
and production
environment in React Native iOS Application.
Recent Articles
- Setup Environment file in React Native Android App
- Setup React Native Project
- Higher Order Components for better code readability
What does mean the debug , staging and production environment?
DEBUG (development env.)
This environment is used by us (developer) to develop and test the application.
STAGING (testing env.)
After development , we will give staging environment’s build to testers for the testing.
PRODUCTION (production env.)
This environment’s build will be deployed on the Play Store and available for the users.
whenever you make any application , whether it is web or mobile. It’s a good practise to make these environment. At the end you got to know why we have to setup these environment files.
Let’s see how to setup these environments
Step 1 →
npm i react-native-config
First add this package on hitting this command on the terminal
Step 2 →
After that create three .env (debug , staging and production) file in the root folder of the project.
Open these file and create as much as variables you can
- .env.development →
ENV = DEBUG
- .env.staging →
ENV = STAGING
- .env.production →
ENV = PRODUCTION
As you can see above , we have only one variable ENV
common in all the files, only the value is different.
Step 3 →
Now open the ios
folder in Xcode. Open Xcode , click on open existing project
, go to you…