Android Firebase Cloud Messaging Subscribe to a topic

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

Client apps can subscribe to any existing topic, or they can create a new topic. When a client app subscribes to a new topic name, a new topic of that name is created in FCM and any client can subsequently subscribe to it.

To subscribe to a topic use the subscribeToTopic() method specifying the topic name:

FirebaseMessaging.getInstance().subscribeToTopic("myTopic");


Got any Android Question?