0

How is that Google, in Firebase Console Notification composer, allows to set notification target to a specific app package name, yet I read there is no way to do it with API? How to send Firebase message to specific application in project?

Is there some hidden capability Google not exposing to devs?

I know about topics, but it takes extra work to set and subscribe to, plus they won't work right away and require some wait time.

kodr
  • 1
  • 2
  • The link to #44364394 was to refer to a quote by Frank van Puffelen about "there is no support for such targeting in the Firebase Cloud Messaging API". I did not mean it answers my question. – kodr Feb 18 '21 at 09:02

1 Answers1

0

The Notification Composer is an online tool hosted by Firebase.
Therefore it already knows the Server Key (required to send messages) associated to each of your projects.

By design (and for obvious security reasons), the Server Key is implicitely linked to a single app, and you can't use it to send a message to different apps.

Simon Marquis
  • 7,248
  • 1
  • 28
  • 43
  • Simon, appreciate sharing. What I meant asking though, was Why – per Frank van Puffelen – there is no way to target notification to a package via Firebase API. Let's look at it this way: a front end, after all said and done, calls the back end, which means, invoking APIs. Does it mean there's an API way to targeting package, undocumented or what not? What could be reason for? Myself I would much prefer targeting app package than doing the topics dance – kodr Feb 18 '21 at 09:11
  • Because a package name doesn't mean anything. You can build an app with the same package name as Facebook for instance. – Simon Marquis Feb 18 '21 at 10:14
  • Yeh I guess you can build it locally, but you won't be able to upload and distribute it via GooglePlay, right? I believe their docs state that package name should be a unique thing, like an identifier of sorts. – kodr Feb 23 '21 at 07:19
  • Yes, applicationId must be unique on the Google Play Store. Package name can be anything. – Simon Marquis Feb 23 '21 at 09:21