Elior
Elior

Reputation: 3266

Firebase FCM, multiple apps in the same firebase project

I have a Firebase project in which I registered multiple apps. now I want to add push notification, and I want to be able to distinguish which app should wake up by the push notification.

in the google-services.json file, I see that all the apps have the same value for the current key in api key section, I understand it is because I registered the apps in the same Firebase project.

I also read about the SERVER_KEY, and saw that there is an option to add SERVER KEY. can I add multiple server keys and use them in my server, in order to send the push notification for the correct app?

or is there any other solution that allows me to keep the apps registered in the same Firebase project but distinguish which app should wake up by the push notification?

Upvotes: 5

Views: 4850

Answers (1)

MCMatan
MCMatan

Reputation: 8863

Yes, You can use multiple apps within the same project, you can use the firebase data structure to distinguish between apps:

(Use it as using channels) https://www.firebase.com/docs/web/guide/structuring-data.html

With that said, from my experience, this is not recommended. At iOS platform, when multiple apps on the same device shared the same firebase keys, it caused some strange behavior for me, so my advice would be to open a new project per app (Pretty sure that is the documentary best practice too) Android worked fine.

Upvotes: 5

Related Questions