For me, I am looking for information about how to setup the environment with multiple configurations. For example, the API endpoint for my development and testing is not the same for production so how could I approach this?
I could require some file but still I need some soft of environment to be able to switch configurations
expo does not do anything about your gitignore, if you require the file then it is used. sure, you can do that, whatever works for you!
to determine the environment you could do:
Constants.manifest.xde - this is true when in development (in either xde or exp).
__DEV__ if this is true, development mode is enabled (you can disable development mode while working in xde)
Constants.manifest.releaseId - this is a string when deployed, __DEV__ is false here
we will add first-class support for environments at some point but right now you’ll need to do something like what was suggested in the original thread you linked to or the above.
Are you sure extra is working? I’m on “22.0.0” and added “extra”: { “foo”: “bar” } to app.json. I get undefined when calling Expo.Constants.manifest.extra (not in the Expo.Constants.manifest object).
I’m not sure if you’ve tried this but when making changes to app.json you should restart XDE/exp and also force quit the client app for good measure (the latter is technically not necessary but the more state we can clear the better).