0

When I am developing my React Native expo iOS app on my dev machine, I want the API_URL variable to be http://localhost:3000. On the other hand, it should be https://api.website.com when the app is built.

Or something similar where the app can detect the environment it is running in, whether its in dev mode or a published version downloaded from the app store, and use the correct API_URL value.

How can we let this happen automatically? Looked into expo-constants

gameveloster
  • 901
  • 1
  • 6
  • 18
  • Does this answer your question? [Setting environment variable in react-native?](https://stackoverflow.com/questions/33117227/setting-environment-variable-in-react-native) – Muhammad Saqlain Apr 01 '23 at 09:30

0 Answers0