firebase-ios-sdk icon indicating copy to clipboard operation
firebase-ios-sdk copied to clipboard

iOS returns the FCM token, but the cloud uses firebase-admin and it shows UNREGISTERED. How can I fix this problem?

Open songzhiming opened this issue 3 months ago • 2 comments

Description

extension PushKit: MessagingDelegate { // fcm回调 public func messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String?) { guard let token = fcmToken else { return } Log.info("PushKit", "FCMToken---\(token)") this token upload to server,but server uses firebase-admin and it shows UNREGISTERED。

and server firebase-admin verision is 9.0.0

Reproducing the issue

No response

Firebase SDK Version

10.23.0

Xcode Version

15.1

Installation Method

CocoaPods

Firebase Product(s)

AB Testing, Analytics, Crashlytics, Performance, Remote Config

Targeted Platforms

iOS

Relevant Log Output

No response

If using Swift Package Manager, the project's Package.resolved

Expand Package.resolved snippet

Replace this line with the contents of your Package.resolved.

If using CocoaPods, the project's Podfile.lock

Expand Podfile.lock snippet

Replace this line with the contents of your Podfile.lock!

songzhiming avatar Apr 28 '24 03:04 songzhiming

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

google-oss-bot avatar Apr 28 '24 03:04 google-oss-bot

img_v3_02ac_2d4a47b7-0898-461f-ba44-c202e41f020g this is cloud log

songzhiming avatar Apr 28 '24 06:04 songzhiming

Hi @songzhiming, with the unregistered error, the existing registration token can be rendered invalid in the following scenarios:

  • If the client app unregisters with FCM.
  • If 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
  • If the registration token expires (for example, Google might decide to refresh registration tokens, or the APNS token has expired for iOS devices).
  • If the client app is updated but the new version is not configured to receive messages.

For these cases, you may remove this registration token from the app server and stop using it to send messages.

If the issue persists, it's possible that this might be a backend issue. In this case, please file a ticket through our support channel so the team could investigate your project.

rizafran avatar Apr 29 '24 19:04 rizafran