[Firebase Mobile] How to send notifications to all Android/IOS devices with the app?
firebase-mobile
Mobile icon
Forge component by David Sousa
Application Type
Mobile

Is it possible using Firebase to send notifications to anonymous users? That is, I created an app, where there is an Events tab. And whenever a new event is created, I intend to send a notification to all devices that have the app installed. There are no users.

How can I do this?


Thank you for your help.

Champion

Hi Henrique,

You can subscribe all the devices to a generic topic (using SubscribeTopic when your app starts) and then use SendNotificationToTopic to that same topic.

Cheers,

David

Hi David, Thanks for the help given. 

Okay, so I'll put the "SubscribeTopic" in the OnAppReady event, but what do I put in the Topic?

Then I will use SendNotificationToTopic, and use the FCMServerKey, to send the key that I have created in FireBase. (I already have this key)


"Title" and "Body" will be notification content.

And the "Topic", I suppose it has to be the same one I used in the "SubribeTopic"

Right?

This action (SendNotificationToTopic) will be on the "Create Events" button. And so whenever a new event is scheduled, everyone who has the app will know.

Obrigado


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.