5

One of my android application is developed using React-Native and I have plans to distribute this using app-center as this app is for Internal users. In App-Center I have different projects (created new app) for the different environments - one for dev, one for uat and one for production.

My issue here is whenever I create build package (apk file) to deploy to App Center project, I need to manually change the app-center config. I have used .env config file to get config for different environment. But I can't use this to set app-center config. Can anyone guide me how I can automate this process by either configuring the app-center in .env file or somewhere in code?

Joe 89
  • 850
  • 1
  • 12
  • 30

1 Answers1

2

If you want to use a specific configuration for each build with the same code, you should use the appcenter's environment variable.

Just add an "app_secret" environment variable, and use a pre build script to create a appcenter-config.json file containing the app_secret

sanjar
  • 1,081
  • 2
  • 9
  • 15
  • have a look @ https://blog.usejournal.com/react-native-config-and-appcenter-environment-variables-a1a3492ca6a0 – fluxsaas Dec 11 '20 at 11:33