Capacitor Environment Variables - Similar to Android Default Config / Flavours #3815
Unanswered
tonyawad88
asked this question in
General
Replies: 1 comment
-
Currently there is no simple way. You would have to rewrite the file in your build script. Capacitor 3.0 will be switching to a JS/TS config file, so it can be changed dynamically. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I have a question related to Capacitor config file capacitor.config.json, I was wondering if there's a way to override any of these variables at build time?
Our use case, we have 2 environments that our mobile app runs in and each environment has its own build configs / properties that needs to get seet.
We use angular environment.ts to manage the angular side of variables per environment. We also use Android build types in the build.gradle file to override applicationId (com.x.y.staging, etc) and to override version name (v1.x.x).
However, the application name "My App" is set within the capacitor.config.json and we would like to have AppName + suffix from Capacitor (ex: appName: "My App - Staging" would be in capacitor.staging.config.json). Is this something that is on the roadmap or open to consideration?
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions