firebase-ios-sdk
firebase-ios-sdk copied to clipboard
FCM Token auto invalid after a few days
[REQUIRED] Step 1: Describe your environment
- Xcode version: 13.3.1
- Firebase SDK version: 7.1.0
- Installation method: CocoaPods
- Firebase Component: Messaging
- Target platform(s): iOS
[REQUIRED] Step 2: Describe the problem
I got a problem the same with the ticket (https://github.com/firebase/firebase-ios-sdk/issues/1543)
Sometimes FCM Token in our app auto invalid without the app not activating, the app is only in background mode, and we ensure that the app doesn't make active. But after one or two days (maybe more days), we cannot send push notifications to the app. We got an error message like this:
{"multicast_id":6531157188326161436,"success":0,"failure":1,"canonical_ids":0,"results":[{"error":"NotRegistered"}]}
We sent a bug report to Firebase with the id Case 10192070
. Could you help us check more detail?
Hi @wickyou23, according to our docs, NotRegistered
error occurs when:
- The client app unregisters with FCM.
- The client app is automatically unregistered, which can happen if the user uninstalls the application. For example, on iOS, if the APNS Feedback Service reported the APNS token as invalid.
- The registration token expires (for example, Google might decide to refresh registration tokens, or the APNS token has expired for iOS devices).
- The client app is updated but the new version is not configured to receive messages.
With this, it is safe to delete the token from the app server and stop using it to send messages. I suggest getting a new registration token from the client app and update the list in your server respectively to avoid sending messages to an invalid token, that also causes the error.