Solution 1 :
For flavors (stage,prod) you should place separate json files in corresponding directories for android project.
I need to do a configuration, with android and iOS that when doing the deployment accepts the change, it is configured with firebase, which when I create a project and configure it, gives me a file google-services.json and in iOS a GoogleService-Info.plist, what I need is that for different environments, which are created in firebase, for example I would like to add the file google-service.json for the production environment, but if it is in staging, use the google settings- service-staging.json and so on.
So when you call the change in the project’s build.gradle, pass it a global variable (I don’t know if it can really be done)
def servicesJSON = file('google-services'+enviroment+'.json')
Something like this, so that depending on what comes to you, you know in what environment they are deploying…
Comment posted by Sébastien
This behavior is not part of Ionic or Capacitor, you just have to write a script that read an environment variable and write the appropriate settings to your GoogleService-Info.plist or google-services.json file. Then run that script as part of your build sequence.
Comment posted by Pietrek
You are more than welcome. Lemme know if you need any help with that 🙂