I am building an Android and iOS app that will use Google Cloud services via Firebase (authentication, data, messaging, etc). How do I set up the Firebase project for a release process? I'm envisioning there will be a development, staging, and production environment.
According to How to setup a different Firebase project for Debug and Release environments, you should set up a separate Firebase project for each environment.
However, I got an error when I tried to add the Android project to multiple Firebase projects:
A Firebase or Google Cloud project contains an OAuth 2.0 client ID (such as another registered Android app) that has the same package name and SHA-1 key that's listed for one of your Android apps in this project. Before you can download this config file, you'll need to resolve this issue.
I figured I should reuse the same Android project across Firebase projects because the Android development system has a mechanism for multi-stage release, namely the buildType
. I thought I would try to set it up as follows:
- android-proj
buildType
"debug" points to firebase-proj-dev - android-proj
buildType
"staging" points to firebase-proj-staging - android-proj
buildType
"release" points to firebase-proj-prod
The Google Firebase error above leads me to believe the multi-stage release process can't or shouldn't be set up this way.
Does anyone know a better way to set up the environments for a multi-stage release process where the following components are involved:
- Android app
- iOS app
- Google Firebase services (Database, Storage, Functions, etc.)
Ultimately, I'd like three independent environments, particularly for the database: development, staging, production.