I have created a small App that's able to receive Push Notifications from the FCM Console.
What i want to do now is to send a Push-Notifications to all Android Phones that got the app Installed using the API. And this is where i got completely lost. Is there no way to send it to all Phones without collecting all the registration-ids? Does this only work with the Console but not with the API?
thanx in advance
For sending FCM notification payload you can use Firebase Cloud Messaging Tool in firebase console. And click on Send your first message. Then enter the Title and body field. If you wish to send it to a particular device then click on Send test message and enter the FCM registration token.
Sending a message to all the phones like what you do from the Firebase Web Console is only possible from the Web Console. If you need this feature from the API you can submit a feature request: https://firebase.google.com/support/contact/bugs-features/
Another possibility is to have all the client registering to a specific topic via FirebaseMessaging.getInstance().subscribeToTopic(topicName)
In this way you can send a message to the whole topic without collecting the registration-ids manually.
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