Subscribing to multiple topics Fail
Why am I getting <FIRMessaging/WARNING> Failed to subscribe to topic Error Domain=com.google.fcm Code=5 "(null)"
When subscribing to multiple topics. Since, there is no callback to queue multiple calls, we can only call in a loop like below
In this case are you eventually successfully subscribing to the topics, or does the subscription continue to fail? If a subscription is unsuccessful the library will retry.
Subscription is failed and the user never received messages sent to that topic. Error happens immediately when the second call is made in the loop..
I am able to reproduce the error log message but I'm still able to receive the notifications sent to the topic.
Are you getting a {"message_id":
I think yes, we did receive message_id. We will re-check this later since we rolled back the code.
Thanks for giving it a try, I'll close this issue then, but please file a new issue if you confirm that successfully sent messages are not being received on the client.
Just to contribute to this discussion. I get the same message while subscribing to multiple topics but the subscription goes through. I'm still concerned about this issue. Any pointers to fix this? Are there any methods in the API to check if a topic has been successfully subscribed to?
I'm seconding this. When subscribing to multiple topics, the error codes comes up. There should be a completion callback or some kind of status so we could know whether it successfully subscribed or not.
The worst part about this is that it fails sometimes, it succeeds sometimes. So there's no way to know for sure which makes it all the more unnerving. The folks who subscribe to a topic sometimes get the PNs, sometimes they don't.
But why is this issue closed? I can see it all the way. If you loop through several topics with subscribeToTopic, you get the error: "<FIRMessaging/WARNING> Failed to subscribe to topic Error Domain=com.google.fcm Code=5". Moreover, if you loop through several topics with unsubscribeFromTopic, you get the same error.. Third, it feels so strange that there is no way to get the result from the subscribe/unsubscribe, e.g. via callback. So that one could act upon the error.
How to re-open the issue? Or should we create a new one?
Why this issue closed?? Issue still in the latest library
its happens me to ! "Update" after I update sdk the problem fix (-:
This happens on iOS and even when you are not into a loop, just a single subscription request.
Hmm you shouldn't be seeing a code 5 issue when subscribing to topics (this code that generates a code 5 was removed). What exactly is the issue you're seeing? Could you post it as a separate issue?
Sorry which version/commit has this fix? Got the latest and I still same error when subscribing to multiple topics!
@travoux This should be available since February this year (FirebaseMessaging 1.2.2). Can you share with me your console log that shows the code 5 for subscribing/unsubscribing to topics?
@rsattar I'm my case it seems the problem was a timing issue. I was trying to subscribe to a topic as soon as the platform.ready event was fired (I'm using Ionic).
I moved the code to call the subscription function later and it works fine. But just for the record I'm not subscribing to several topics at a time, just one, so I can't testify the other problem is fixed or not.
Hi all , I am getting issue Failed to fetch APNS token Error Domain=com.firebase.iid Code=1001 "(null)"
var myTopics = "all";
this.fcm.subscribeToTopic(myTopics).then(success => {
console.log("***Here is success****"+success); alert(success) },
error => { console.log("***This is the issue****"+error); alert(error);})
.catch(response => {
alert(response);
console.error('Gists error = ', response);
});