How To Create Topic in FCM Notifications

Moh'd Awad picture Moh'd Awad · May 21, 2016 · Viewed 71.9k times · Source

I'm trying Firebase-Notification API the service is worked perfect when i send downstream message from console to app, but how to send message to topic registered users ?

i did in android side

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

but when i try send downstream message from console to topic it's says

This project does not have any topics

EDIT : i figured out that after mapping the topic it's take up to 1 day to show up in Firebase Console

Answer

Juan Pablo picture Juan Pablo · May 24, 2016

This is an alternate path.

If you subscribe a client app to an unexisting topic then the topic will also be created without having to call any firebase url request.

It' will also take a couple of hours to appear on Firebase Console.

By using google shared example: https://github.com/firebase/quickstart-android/tree/master/messaging you can confirm the same.

        FirebaseMessaging.getInstance().subscribeToTopic("news");
        Log.d(TAG, "Subscribed to news topic");