2

I have a back-end service that uses firebase to send push notifications to an application.

Technically, it is not 1 application but 3 applications in playstore. They have different package name so they are hosted in separate firebase projects.

This means that the back-end service must use 3 different server keys (one from each firebase project, for each application). I would like however to have only one server key, which means that either the different play store apps must be hosted in same firebase project, or the 3 different firebase projects should use the same server key.

From what I read, the first option is not possible. What about the second?

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Lazarus Rising
  • 2,597
  • 7
  • 33
  • 58
  • There may be multiple apps on single Firebase account...but server key will be same for all as i used for my projects.. – kulvinder Apr 13 '18 at 12:57
  • I understand that there can be multiple apps in same firebase project (project, not account). Currently in my account, I have 3 projects. One of them has an android app and an ios app. The other 2 projects have each one android app. The 3 android apps were published as different applications in playstore, declared with different package names. Now each project has one server key, which leads to the situation of 4 applications in total with 3 server keys. To send push notifications to all the applications, I have to use separate keys for each project. Idk if I made it a bit clearer. – Lazarus Rising Apr 13 '18 at 13:02

1 Answers1

3

FCM Server keys are tied to a Firebase project. Each project has its own FCM Server key. There is no way to copy the FCM Server key from one project to another.

If you have apps in separate projects, you will need to use a separate server key for each app.

If you want to use a single FCM Server key for all apps, you should add them to a single project. Even when you have multiple apps in multiple packages this is usually possible, since there is a limit of 30+ apps per project.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • I understand what you say, and I could not find any option / way to set the key manually for different projects. Also I understand that several applications (30+ apps) can belong to same project. Currently I have one ios and one android app in the same project. But my android developer partner says that the other 2 android apps cannot belong to same project because they were published as different apps in playstore and have different package names. I did some reading and it seems to be true. Before we had all android apps in the same project, but she had to separate them. – Lazarus Rising Apr 13 '18 at 13:24
  • You can have multiple Android apps in a single Firebase project, each having their own unique package name. Firebase doesn't force them to have the same package name. But if you have other reasons for having them in separate projects, you'll have multiple FCM server keys and will have to deal with them. – Frank van Puffelen Apr 13 '18 at 14:06
  • Even when you have multiple apps in multiple packages this is usually possible what its mean? Can we communicate two apps with two different projects? – Rishav Singla Nov 29 '19 at 10:21