Subscribe to topics
A topic is like a group you can subscribe in order to send push notifications specifically to that topic, you can subscribe to multiple topics creating a MBTopic
Arraylist with the topic names, then call the API:
From the MBurger Push dashboard
then you can send push notification only to some topics of making an app send push notifications to a specific topic. While it's not necessary to subscribe to topics at every startup, it can be useful to resubscribe anytime your InstanceID
changes in order to maintain data coherence.
When you receive a push notification then your FirebaseMessagingService
will be triggered and you will find all the data you inserted on the "data" field of the RemoteMessage object.
To create a notification with the Android SDK refer to this documentation.
Push topics management
To unsubscribe from a push topic you'll need to call the unregisterTopics() API with the same fields you used with registerTopics(). You can also unsubscribe to all topics you subscribed by calling:
This way you'll no more receive push messages from any topic you registered the device before.
Last updated