-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Push Notifications Fail After App Reinstallation #14246
Comments
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight. |
Hi @JCsplash, your issue seems related to #10679 (comment), especially that you've recently updated from a Firebase version before the change mentioned went into effect. You may also consider checking this troubleshooting guide. |
Hey @rizafran why is v10.4.0+ still providing a non-nil |
The SDK doesn't return an FCM token when the APNs token is not available. When the firebase-ios-sdk/FirebaseMessaging/Sources/Token/FIRMessagingTokenManager.m Lines 189 to 192 in 75cc4df
I have installed and uninstalled several different apps multiple times, but I am still unable to reproduce the issue you reported. Is this issue specific to your app? Can you reproduce the issue using our sample app? https://github.com/firebase/firebase-ios-sdk/tree/main/FirebaseMessaging/Apps/Sample |
Hi @leojaygoogle I also get the same error |
Yeah, firebase-ios-sdk/FirebaseMessaging/Sources/Token/FIRMessagingTokenManager.m Lines 78 to 80 in 75cc4df
If you need the current token, please follow the doc: https://firebase.google.com/docs/cloud-messaging/ios/client#fetching-the-current-registration-token |
Description
Description
After deleting and reinstalling the app, Firebase Cloud Messaging (FCM) push notifications fail to work until the app is quit and restarted once or twice. This issue seems to be related to the APNs token not being set before retrieving the FCM token.
Error Messages
The following errors are logged during the issue:
The operation couldn’t be completed. No APNS token specified before fetching FCM Token
APNS device token not set before retrieving FCM Token for Sender ID. Be sure to re-retrieve the FCM token once the APNS device token is set.
Declining request for FCM Token since no APNS Token specified
Steps to Reproduce
If you quit and restart the app multiple times, the notifications begin to work.
Code Snippet
This is the code used to register for remote notifications:
Environment
Firebase SDK Version: Upgraded from 8.8.0 to 11.6.0
Xcode 16.1
Swizzling: Enabled
Push Notification Settings: Configured as per documentation
Expected Behavior
After deleting and reinstalling the app, push notifications should work immediately without requiring multiple restarts of the app.
Actual Behavior
Push notifications fail to work immediately after reinstalling the app. The following errors are logged until the app is restarted once or twice:
The operation couldn’t be completed. No APNS token specified before fetching FCM Token
APNS device token not set before retrieving FCM Token for Sender ID
Declining request for FCM Token since no APNS Token specified
This issue did not occur with Firebase SDK version 8.8.0 but surfaced after upgrading to version 11.6.0.
Reproducing the issue
Steps to Reproduce
If you quit and restart the app multiple times, the notifications begin to work.
Firebase SDK Version
11.6.0
Xcode Version
16.1
Installation Method
CocoaPods
Firebase Product(s)
Messaging
Targeted Platforms
iOS
Relevant Log Output
No response
If using Swift Package Manager, the project's Package.resolved
Expand
Package.resolved
snippetReplace this line with the contents of your Package.resolved.
If using CocoaPods, the project's Podfile.lock
Expand
Podfile.lock
snippetReplace this line with the contents of your Podfile.lock!
The text was updated successfully, but these errors were encountered: