Skip to content

Pass env vars to dynamic app configuration & build APKs #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 17, 2022

Conversation

sauloperez
Copy link
Collaborator

It's not immediately obvious on
https://docs.expo.dev/guides/environment-variables/, but it turns out that for ENV vars specified in the eas.json's profiles to be read from Constants.expoConfig.extra, the app configuration needs to be dynamic and set them from process.env.

This fixes the issue we were trying to solve on
https://github.com/coopdevs/timeoverflow-mobile-app/pull/14/files#diff-9b5b5955d0e684e7904f3fc143e07aaa11b7e7c3b36d10985c4aff2554940cbfR24.

Besides, using dynamic configuration gives more options to better adapt it to our needs. Check https://docs.expo.dev/workflow/configuration/ for details.

It's not immediately obvious on
https://docs.expo.dev/guides/environment-variables/, but it turns out
that for ENV vars specified in the eas.json's profiles to be read from
`Constants.expoConfig.extra`, the app configuration needs to be dynamic
and set them from `process.env`.

This fixes the issue we were trying to solve on
https://github.com/coopdevs/timeoverflow-mobile-app/pull/14/files#diff-9b5b5955d0e684e7904f3fc143e07aaa11b7e7c3b36d10985c4aff2554940cbfR24.

Besides, using dynamic configuration gives more options to better adapt
it to our needs. Check https://docs.expo.dev/workflow/configuration/ for
details.
Otherwise we won't be able to publish this build to the Play Store.
@sauloperez
Copy link
Collaborator Author

I just checked it again and the build does point to production 👌 , and it's also an APK.

@sauloperez sauloperez changed the title Pass env vars to dynamic app configuration Pass env vars to dynamic app configuration & build APKs Dec 17, 2022
@sauloperez sauloperez merged commit cf7cc8c into master Dec 17, 2022
@sauloperez sauloperez deleted the fix/base-url branch December 17, 2022 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant