Reputation: 321
I'm using Firebase Cloud Messaging and I'm trying to create topics programatically from my android app. I cannot find a way to create a topic, but there's this method called subscribeToTopic(String topic)
that allows me to subscribe the device to a topic and get it's messages. How can I CREATE a topic from my android app? Is there a way to do it in Java so I can also create topics in my server? Thanks!
Upvotes: 0
Views: 3953
Reputation: 321
Solved! When you do FirebaseMessaging.getInstance().subscribeToTopic("newTopic")
, if the topic called "newTopic" doesn't exits, it is created and the user is subscribed to that new topic.
Upvotes: 2