0

I subscribed and later unsubscribed a device from a topic in Firebase Cloud Messaging.

Now when I try to subscribe again nothing happens. On the device the code FirebaseMessaging.getInstance().subscribeToTopic("topicName") is executed and the Log prints no errors.

However if I make a GET request to https://iid.googleapis.com/iid/info/regID/?details=true with the registration id of my device only the other topics are shown, not the one I resubscribed to.

Update: Ok with another topic I actually could resubscribe, but the first one still won't subscribe again. Still no errors or log feedback during execution. Anyone an idea what this could be? Are there maybe any formatting rules for the topic name as mine is an automatically generated ID?

einworB
  • 33
  • 8
  • Maybe a typo? Do you have a space or something in it? – greenhoorn Sep 14 '16 at 14:11
  • At least I can't see any. I can successfully resubscribe to the topic `-KQRVqa87j1ns3KLMbAF` but resubscribing to `-KQMZG0yL3rqVUv7eoXh`never works – einworB Sep 14 '16 at 14:31
  • Wrong API key or something? I had the same problem with the old gcm. I accidently hit space while the cursor was in my API key... Had a hard time to find out where ^^ – greenhoorn Sep 14 '16 at 14:40
  • as I said subscribing to other previously unsubscribed topics with exactly the same setup works – einworB Sep 14 '16 at 22:55

1 Answers1

1

So...the missing topic kind of resurfaced.

Apparently it was a kind of random error either in my setup (more likely) or in FCM (less likely).

However I'm still 100% sure it did not work for at least a week with one specific topic name and now it's working fine with all my topic names.

einworB
  • 33
  • 8
  • You should remember 3 things: 1.regular expression: "/topics/[a-zA-Z0-9-_.~%]+" 2. Event names can be up to 40 characters long 3. The "firebase_" prefix is reserved and should not be used. – MiguelHincapieC Jan 22 '17 at 13:43