You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I upgraded my iPhone to iOS 18.1.1, running the Xcode debugging application to try and obtain the token failed,The code is as follows: Messaging.messaging().token { token, error in if let error = error { print("Error fetching FCM registration token: \(error)") } else if let token = token { print("FCM registration token: \(token)") Application.shared.sendPushToken.onNext(token) } }
Log message: Error fetching FCM registration token: Error Domain=com.google.fcm Code=505 "No APNS token specified before fetching FCM Token" UserInfo={NSLocalizedFailureReason=No APNS token specified before fetching FCM Token}
My implementation process is roughly as follows:
The didFinishLaunchingWithOptions in Appdelegate initializes firebase (FirebaseApp. configuration())
Then it called (application.registerForRemoteNotifications()) again.
When App entered the viewDidLoad of the homepage viewController, I made a permission request and attempted to obtain the FCMtoken to upload to my application server. At this point, the above problem occurred.
The code for this section is as follows:
Other information:
I confirm that my code has not been modified. Regarding Firebase, I tried three different versions 10.24.0, 11.4.0, and 11.5.0, and the results were the same.
I have read the official document https://firebase.google.com/docs/cloud-messaging/ios/client My app did not manually register the APNS device token and instead used Method swizzing in Firebase Cloud Messaging
Regarding other logs on FCM:
This problem has been bothering me for a long time. I hope someone can provide help. Thanks.
Reproducing the issue
No response
Firebase SDK Version
11.5.0
Xcode Version
16.1
Installation Method
CocoaPods
Firebase Product(s)
Messaging
Targeted Platforms
iOS, All
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!
The text was updated successfully, but these errors were encountered:
Hi @dongwk2024, this error seems related to #10679 (comment) in which there was a change implemented starting v10.4.0. With this, an APNs token must be provided to the SDK before retrieving an FCM token during startup, otherwise, an error will be returned as part of the completion in which you have encountered. We are declining vending an FCM token until an APNS token is provided.
I also found this related post that would possibly resolve the issue.
Hey @dongwk2024. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.
If you have more information that will help us get to the bottom of this, just add a comment!
Description
When I upgraded my iPhone to iOS 18.1.1, running the Xcode debugging application to try and obtain the token failed,The code is as follows:
Messaging.messaging().token { token, error in if let error = error { print("Error fetching FCM registration token: \(error)") } else if let token = token { print("FCM registration token: \(token)") Application.shared.sendPushToken.onNext(token) } }
Log message:
Error fetching FCM registration token: Error Domain=com.google.fcm Code=505 "No APNS token specified before fetching FCM Token" UserInfo={NSLocalizedFailureReason=No APNS token specified before fetching FCM Token}
My implementation process is roughly as follows:
The didFinishLaunchingWithOptions in Appdelegate initializes firebase (FirebaseApp. configuration())
Then it called (application.registerForRemoteNotifications()) again.
When App entered the viewDidLoad of the homepage viewController, I made a permission request and attempted to obtain the FCMtoken to upload to my application server. At this point, the above problem occurred.
The code for this section is as follows:
Other information:
I confirm that my code has not been modified. Regarding Firebase, I tried three different versions 10.24.0, 11.4.0, and 11.5.0, and the results were the same.
I have read the official document https://firebase.google.com/docs/cloud-messaging/ios/client My app did not manually register the APNS device token and instead used Method swizzing in Firebase Cloud Messaging
Regarding other logs on FCM:
This problem has been bothering me for a long time. I hope someone can provide help. Thanks.
Reproducing the issue
No response
Firebase SDK Version
11.5.0
Xcode Version
16.1
Installation Method
CocoaPods
Firebase Product(s)
Messaging
Targeted Platforms
iOS, All
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: