quickstart-ios icon indicating copy to clipboard operation
quickstart-ios copied to clipboard

Subscribing to multiple topics Fail

Open travoux opened this issue 10 years ago • 17 comments

Why am I getting <FIRMessaging/WARNING> Failed to subscribe to topic Error Domain=com.google.fcm Code=5 "(null)"

screen shot 2016-05-22 at 5 26 36 pm

When subscribing to multiple topics. Since, there is no callback to queue multiple calls, we can only call in a loop like below

screen shot 2016-05-22 at 5 30 52 pm

travoux avatar May 22 '16 09:05 travoux

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.

kroikie avatar May 23 '16 22:05 kroikie

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..

travoux avatar May 24 '16 04:05 travoux

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": } response when sending the downstream message?

kroikie avatar May 24 '16 16:05 kroikie

I think yes, we did receive message_id. We will re-check this later since we rolled back the code.

travoux avatar May 25 '16 06:05 travoux

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.

kroikie avatar May 29 '16 17:05 kroikie

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?

Shoshin23 avatar Jun 20 '16 16:06 Shoshin23

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.

martolini avatar Aug 06 '16 12:08 martolini

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.

Shoshin23 avatar Aug 07 '16 12:08 Shoshin23

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?

olegdynamo avatar Nov 09 '16 13:11 olegdynamo

Why this issue closed?? Issue still in the latest library

jacksonej avatar Feb 07 '17 12:02 jacksonej

its happens me to ! "Update" after I update sdk the problem fix (-:

RoeeNadam avatar Mar 27 '17 14:03 RoeeNadam

This happens on iOS and even when you are not into a loop, just a single subscription request.

ElNinjaGaiden avatar Jun 22 '17 00:06 ElNinjaGaiden

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?

rsattar avatar Jun 23 '17 19:06 rsattar

Sorry which version/commit has this fix? Got the latest and I still same error when subscribing to multiple topics!

travoux avatar Jun 24 '17 15:06 travoux

@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 avatar Jun 26 '17 20:06 rsattar

@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.

ElNinjaGaiden avatar Jun 26 '17 21:06 ElNinjaGaiden

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);
          });

Anujmoglix avatar May 03 '18 08:05 Anujmoglix