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
First, given that
IID_TOKEN
is your registration token andTOPIC_NAME
is the topic you want to create, you need to create topic by making a POST request toAnd to check your created Topics make a GET request on this URL
and insert your API_KEY in your Request HEADERS
Your topic will take up to 1 day to show up in Firebase console so for testing you can make curl request or use sofware like Advanced REST client
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.
You can create a topic with http api:
https://iid.googleapis.com/iid/v1/IID_TOKEN/rel/topics/TOPIC_NAME
1. IID_TOKEN = Device registration token, you can find it with following command on your android device :
2.TOPIC_NAME = new a topic name
3.Authorization: key=YOUR_API_KEY. Set this parameter in the header. Look to screenshot: Creating new topic via Advanced rest client
YOUR_API_KEY: console.firebase.google.com
and send request and you will be receive http status "OK".
Then you can get infos about all your topics in your current project with following api :
here need add Authorization key to header of request and you will be receive your topics list: response info topics
I recommend read this article about Instance ID/Server by Google
Firebase takes time to create new topic in console. In my case, new topic was created after 4 hours.