Search code examples
iosswiftfirebasefirebase-cloud-messagingfirebase-console

topics are not displaying in firebase console


I have added below code to subscribe topics in Firebase:

Messaging.messaging().subscribe(toTopic: "topics/news")

I have waited for more than 24 hours. it is still not available in firebase console.


Solution

  • You should not include the topic/ in the topic name.

    try

    Messaging.messaging().subscribe(toTopic: "topics/news")
    

    see the example here:

    https://firebase.google.com/docs/reference/ios/firebasemessaging/api/reference/Classes/FIRMessaging#/c:objc(cs)FIRMessaging(im)subscribeToTopic: