We are integrating firebase messaging in our android application for push notifications. We are going to use SNS from server side to send push message to firebase. Below is our use case:
This is first time that we are venturing in world of push notifications on android.
PS: The obvious solution is to just have one project in firebase and configure it on client and all of our servers can use the same project but ideally we want separate project for Production vs QA/STG
However, when you want to access multiple projects from a single application, you'll need a distinct Firebase application object to reference each one individually. It's up to you to initialize these other instances.
You can't have two projects of the same package name. Even if you delete it. It will take a least 4-5 days to get deleted fully from the developer's console. So the only solution is to generate a new SHA-1 key by custom signing the app by generating a signed apk from the android studio.
A Firebase project can have one or more Firebase Apps registered to it (for example, both the iOS and Android versions of an app, or both the free and paid versions of an app).
Firebase Android SDK is designed to work with one Firebase project by default. But it is quite possible to access multiple projects in a single App due to different reasons. One common case in the industry is, for example, the requirement for having multiple development environments or delivery stages.
If you really need a single APK that somehow self-selects which Firebase project it works against, you can't use the automatic init provided by the Gradle plugin.
Normally, Firebase apps init automatically (definitely read my blog post there) via data injected by the gradle plugin. This system works in a vast majority of cases, but not in yours.
If the normal case doesn't work for you, you'll have to disable the FirebaseInitProvider via Android build tools (see tools:node="remove"), and initialize your app yourself with FirebaseApp.initializeApp() with a FirebaseOptions that you construct. You need to arrange for the init to happen before any APIs are called, of you'll get errors.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With