简体   繁体   中英

Firebase Push Notifications on iOS: FCM says token error: not registered but app gets no refreshed token

After app installation my app gets PNs and evrything works fine. But suddenly, the app did not get any PNs anymore.

A manual pushtests to the specific tokenID gets the following answer from Google's Firebase Server:

{"multicast_id":XXXXXXXXXXX,"success":0,"failure":1,"canonical_ids":0,"results":[{"error":"NotRegistered"}]}

So it seems that the token ID is not registered anymore in Firebase.

But I still get with InstanceID.instanceID().token() the same old token and not a new one.

I have quite the same setup like in the Messaging Example from quickstart-ios. I have also already updated to the newest Pod Versions:

Installing Firebase 4.0.2 (was 3.6.0)
Installing FirebaseAnalytics 4.0.1 (was 3.4.2)
Installing FirebaseCore (4.0.2)
Installing FirebaseInstanceID 2.0.0 (was 1.0.8)
Installing FirebaseMessaging 2.0.0 (was 1.2.0)

But still with the same result: FCM connection and registration is working, also the same result with and without swizzling...

Any ideas how I should further debug this issue?

I might have found a solution... Of course I have no way to test this more rigorously since my single device that had this issue doesn't anymore. :)

You'll just have to register for remote notifications again. UIApplication.shared.registerForRemoteNotifications()

Before, I used to check notification authorization status and only registered for remote notifications when it was .notDetermined . Now I also register for remote notifications right away when the authorization status is .authorized .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM