I need guidance on setting dev-staging-prod with firebase and android with full data isolation on the server side and ability to support the same via android. Plus I will have debug and release version of build. I am getting stuck because of the packagename + SHA constraint on firebase side. It is clear in firebase you can have the same SHA-1 in two projects, but the package names of the app (also called "application id") must be different. Likewise, you can have two projects that have the same package name, but they can not have any of the same SHA-1 added to them.
MUST HAVE: DATA ISOLATION OF ALL THREE ENVIRONMENTS I have a creatde 3 firebase projects under my account using Firebase console. 1) project-dev 2) project-staging 3) project-prod
I also want to in Android support 1) Debug 2) Release modes
I have a team of engineers who will push to dev, a select group pushing to staging and prod.
For dev isolation I can have developers use their sandbox account and hence the SHA key issue is resolved.
Staging/Prod: But how do I solve the staging/prod since the package name will be same. Do I have to add another suffix so that firestore won't complain? For debug and production I have rules to add applicationIdSuffix.
The package name will be com.mycompany.productname.
Release will be in prod. debug in dev and staging.
In Android I was planning on having flavours like this to point to the google_services.json so that the server side dimension of my app is handled. app/ src/ main/ dev/ google-services.json (for dev only) qa/ google-services.json (for qa only) prod/ google-services.json (for prod only)
and accordingly update the android app grade files
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
applicationIdSuffix '.debug'
}
}
// Specifies the flavor dimensions.
flavorDimensions "server"
productFlavors {
dev {
dimension "server"
}
staging {
dimension "server"
}
prod {
dimension "server"
}
}
How do I manage the SHA keys now, since for an application id (package name) only one SHA key is permitted.
The combination of package name and SHA-1 must be unique