I'm working on an Android project with multiple Flavors and of course each one has debug and release builds, our setup is to have the API end-points pointing to staging and release pointing to live server, I'm using Google play services plugin for Grade
classpath 'com.google.gms:google-services:2.1.0-alpha5'
The problem I'm facing is with google-services.json since it's not possible to have one for Debug and one for Release (per each flavor). In our project Flavors represent countries (with different brand names and languages).
Why do I want to use different GCM sender per flavor per build-type? Because in both apps, users subscribe to Topics and we send push messages to topics not to individual users, so we collect GCM tokens just for reference, but the sending is always topic-based, so if you have the same topic name in Debug and Release you'll run into trouble.
so any accident during testing by sending for example to topic "X" will end-up delivery messages to Live users as well as Staging (debug). The other thing, we still don't want to have it per Release type, cause not all Flavors will have the same Sender.
so the Ideal solution would be something as follows:
-app/src/flavor1Debug/google-services.json (with project_number:"1000001")
-app/src/flavor1Release/google-services.json (with project_number:"1000002")
-app/src/flavor2Debug/google-services.json (with project_number:"9000001")
-app/src/flavor2Release/google-services.json (with project_number:"9000002")
but it seems that Google-Play Services look only for
- app/google-services.json
- app/src/flavor1/google-services.json
- app/src/flavor2/google-services.json
- app/src/debug/google-services.json
- app/src/release/google-services.json
is there any other way to separate Sender id for each "Flavor+Build"?