Crag
Crag

Reputation: 1841

Firebase Cloud Messaging topics stopped working

My devices stopped receiving silent push notifications in the background with topics, but I am able to send an FCM request from the command line to trigger a silent push notification in the background using an FCM Token instead of topics. My code for subscribing to topics and sending notifications with topics hasn't changed since before this broke (the last successful one I know about was on 12/31/19 - maybe something to do with the year switchover?). I did switch from using APNS certs to keys, but I don't know if that could be causing a problem with FCM topics.

Because this works with an FCM Token and not topics I think this is just a Firebase issue, not an app or Apple configuration issue, right?

How can I debug this to get it working? Firebase Cloud Messaging seems to be a black box...

Upvotes: 2

Views: 4095

Answers (1)

Crag
Crag

Reputation: 1841

Firebase support first pointed me at this debugging guide; I suspect this is their first line of advice when people are having trouble with notifications.

For me, the issue was around topics, and here's how I tackled it:

  1. I tried to subscribe a device using its FCM Token from my server - after doing that it responded to this topic, so I knew the problem was with the device subscribing itself.

  2. The Swift topic subscribe/unsubscribe calls are actually async, which I didn't realize, but after I supplied completion handlers I could tell they weren't working, which led to my solution.

Upvotes: 2

Related Questions