I want to handle different environments by letting the developers select which one they want to.
So basically lets say we have a login screen and a "Settings" touchable there. When the user press it, or shake the device, the following modal opens:
I wanna let the user change the environment mode and then restart the application with the selected environment settings.
.env.development
REACT_APP_API_URL=https://development-api.io/api
.env.staging
REACT_APP_API_URL=https://staging-api.io/api
.env.production
REACT_APP_API_URL=https://production-api.io/api
I'm not sure if this is feasable, but my starting point is to try it with react-native-config and react-native-restart. Any thoughts on the best way to do it?
Thank you!
Obs: React Native CLI