Closed jbtheard closed 1 year ago
Hi @jbtheard
Thank you for reaching out. You can specify region in app.config.ts
or app.json
as required. If you are using app.config.ts
then the configuration for env should look like:
.
.
ios: {
pushNotification: {
useRichPush: true,
env: {
siteId: "someValueForSiteId",
apiKey: "someValueForApiKey",
region: "US" // change this to EU, if your workspace is in EU region.
}
}
}
.
.
For more details, check out our docs here.
oh I missed that page perhaps you shouldn't have any doc in this repo and only point to the doc on customer.io domain ?
Just a suggestion here but rather than using specific env key as iOS param, couldn't we reuse the config available to JS ?
oh I missed that page perhaps you shouldn't have any doc in this repo and only point to the doc on customer.io domain ?
I see what you are saying @jbtheard ! Sorry for the confusion. I will talk with the team about it and see how best we can handle this case.
Just a suggestion here but rather than using specific env key as iOS param, couldn't we reuse the config available to JS ?
I am not sure what you mean by config available to JS. Could you help me understand this ?
so far, I have always used expo-constants to store api keys and configuration. I believe it exposes env variables available to both native iOS, Android, as well as the JS layer (used in your useEffect ).
So my recommendation would be to add a customerio key to extra in app.config.js with all required variables:
{
extra:{
customerio: {
siteId: 'mySiteId',
apiKey: 'myApiKey',
region: 'eu',
},
}
}
Note that it's more a convention than a fix to anything and I may be wrong with that one...
Note: I think Expo is working on a way to use env files for version 49
Please note that the local build does work OK now. Currently testing a remote build on Expo servers...
Many thanks for your thorough explanation. I can clearly see that using expo-constants
can be a relief to the developers. I have taken your feedback and will share with the team.
Closing because it seems the original issue has been resolved.
Feel free to comment back if this issue still persists.
I'm trying to build for iOS and I get the following error:
How can I specify Region variable so that it's picked by the build ? I have tried to add it to app.config.ts but that wouldn't change a thing.