I am getting an error when calling subscribeToTopic in iOS,
Failed to subscribe to topic Error Domain=com.google.fcm Code=5 "(null)"
There are 3-4 topics and we call like below, which is pretty basic..
for topic in topics{
FIRMessaging.messaging().subscribeToTopic(topic)
}
Documentation says that the call is asynchronous and if subscription failed, firebase will retry. But it continued to fail and the user never receives any message sent to that topic.
Anyone facing this issue and found a solution?
I had the same error. Add this to your AppDelegate:
func application(application: UIApplication, didRegisterUserNotificationSettings notificationSettings: UIUserNotificationSettings) {
FIRMessaging.messaging().subscribeToTopic("/topics/yourTopic")
}
and remember to call FIRApp.configure() in didFinishLaunchingWithOptions method.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With