-
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
Messaging.messaging().token returns errors #10679
Comments
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight. |
Similar issue: invertase/react-native-firebase#6830 |
@RobinCaroff Thanks for opening this one and cross-referencing 🙇 While not directly related, it seems contextually interesting that we have started seeing some other previously non-existent behaviors with the Firebase Messaging SDK/React Native Firebase Messaging. We were doing some regression testing for an upgrade of our RN Instabug integration in the App, and encountered another errors on iOS, which we had never seen "surfaced" to our error reporting:
Again, just for context if that helps narrow down how the |
having the same issue as @RobinCaroff how do i resolve it ? |
I'm having the same issues, any tips on how to solve it? |
Hi all, I tried to reproduce the issue but I was able to retrieve the token successfully. With this, could you share a minimal repro app as well as the complete stack trace or app debug logs for further investigation? |
Hi @rizafran . Thank you for your answer. What's really strange is that I also use the same codebase with a different bundle id (my preprod environment) and I don't get the error. I checked the Firebase plist but it is up to date. I'll try to produce a minimal repo where I can reproduce the error. In the meantime, is there any specific Firebase log that I could provide to help you narrow down the issue? |
Also ran into this. I have tried various versions of the firebase pod during the installation of the plugin and still facing the error on emulators as well as production environments. |
This makes it even more curious, since the same exact thing is happening to me. In one of the environments it works flawlessly, the other is failing constantly! |
Having the same issue. No idea what's happening. Started all of a sudden. |
Can we say this is a firebase thingy for sure? |
Maybe Certs are expired...the Apple APN keys are setup, and my Dev and Prod ones are invalid. One in expired last month in December, and the prod one expired Today. This was the exact error I was getting. the EDIT: didn't fix it |
@Seanmclem chaged APNs key Ali but it did not fix the issue maybe it may work you |
@henryadebayo Just tried it too, and no change either. |
So serious problem |
@Seanmclem and @yeahse so i removed the GoogleServices-info.plist file from my Runner folder, then i did flutter clean and clean build folder then flutter pub get and it worked, yet to replace the GoogleServices-info.plist file , i i'm thinking the GoogleServices-info.plist file is corrupt don't know how or if this ever happens will replace it and let you know if it still works |
@henryadebayo I was able to fix it based on your reply, so thanks! However, I was thinking about the plist thing -and felt like it was unlikely that all of our The only other thing we have in common is we both just re-added our APN certificates. So that might be required too, but afterwards restarting the build was definitely the final thing that fixed it for me. |
We are using Firebase Unity SDK 9.40, which wraps Firebase iOS SDK, and we are experiencing the same problem as the issue in this article, so we leave an opinion. In the past week, 2 out of 15 apps in service were only on iOS.
The method we implemented was implemented in items 1 and 2 below.
In one app, the app crash was fixed by removing 2, but in the other app, even if 2 was removed, it was not fixed, so the code implemented in 1 was deleted to respond. Today, we're facing the same issue with the rest of the apps, and we're going to respond the same way we finally responded. However, if you respond in this way, you will not be able to use FCM, so you need to respond quickly. |
I just followed your solution and it does not work |
An update has been made to the Firebase SDK to provide an APN token at launch on the latest SDK release (https://firebase.google.com/support/release-notes/ios) |
If you have an APN token (user has accepted push notification), it must be forwarded to firebase sdk. And then you should be able to retrieve a firebase token. |
@aashishpatil-g , our issue (#10710) has gone after rollback. |
@aashishpatil-g What they have to do is that only SDK 10.4.0 and above is the one that does not allow obtaining the FCM token without the APN, so that this change has to be implemented from that version, because applying it to everyone is not ethical In my case the problem is already solved after rollback, but I will update to 10.4.0 with the new way they ask to obtain the FCM Token |
@DanielReyesDev - thanks for confirming that the issue was resolved. @adirgan - thanks for the feedback. |
It worked, thanks! |
Solved here |
Up here also. @aashishpatil-g if you can give us more infos about the case of this evolution will be live again. Which SDK version, when, etc... |
Solved as well! Thanks! |
It works also on my app. Thanks ! |
Thanks issue is fixed |
I verify that things work now with firebase-ios-sdk for version 10.3.0 after rolling back the server change (thank you! That takes the pressure off us over at react-native-firebase, we appreciate it), but I still show an issue when attempting to qualify firebase-ios-sdk 10.4.0 Specifically, I see this when our e2e test suite exercises the Obj-C API and makes a call to deleteToken:
Okay, that appears to be somewhat expected based on the discussion in this issue and in the related changelog for 10.4.0 firebase-ios-sdk release, however, what I am personally missing (and thus cannot fix for the react-native-firebase community) is some guidance on exactly why the APNS token might be null (despite swizzling being in effect...) and how to forcibly fetch (or re-fetch) an APNS token in order to allow further work with FCM tokens In our test app we are registered for remote notifications, so we should receive APNS tokens, and swizzling is on, so firebase-ios-sdk should be receiving the APNS tokens for messaging. I'm not sure what else we need to do to handle this change and adopt 10.4.0 but would love a hint Thanks [Update: our native code had conditionals that detected simulator and cut-out from the remote notification registration / APNS token fetch flows, so it would never get an APNS token of course! On an M1 mac with macOS 13 + iOS 16 Simulator we can get APNS tokens and everything works even on Simulator now when those conditions are met. We will fake an APNS token for other Simulators, and try to improve dev experience with better messaging for the other cases where APNS token may not be available] |
It works as expected now. |
Following up with some guidance for the Firebase 10.4.0 SDK. As stated in the release notes, 10.4.0 onwards, we are declining vending a FCM token until an APNS token is provided. We have always been logging a WARNING when this has occurred in previous versions of the SDK but haven’t declined to provide a FCM token. Such a vended FCM token is not useful since it is missing a target APNS token and thus has no endpoint to send the pushes to. Scenarios:
UPDATE Mar 1, 2023: This has been fixed in 10.6.0 - #10789
func messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String?)
|
I have solved this issue by mentioning a specific version of the firebase core in Podfile and the rest of the firebase pods will adopt the respective version which will convenient to them.
Remove these files from the project:
and just go with the "pod install". |
But... @kishanbarmawala this reads the same as "I have decided to continue creating invalid FCM tokens in our project, by permanently relying on outdated versions of the software" - I mean that in a technical sense, I believe those are technically valid substitutions in your statement. I totally understand if it is just deferring the maintenance to a future date when project timelines allow but I would be careful adopting that version pin permanently... |
The issue identified in bullet 1 in the comment has been fixed in 10.6.0 - https://firebase.google.com/support/release-notes/ios#fcm I will close this issue since there aren't any opens. |
Description
It has been two days since that last Messaging.messaging().token success with our app.
It currently returns the following error :
Here is how we retrieve the token :
Note 1: the live app has not been updated since 2 weeks and we reproduce the same issue with oldest version.
Note 2: We have a different target using the same code with a different bundle id which does not have the issue.
Reproducing the issue
No response
Firebase SDK Version
10.3.0
Xcode Version
14.1
Installation Method
CocoaPods
Firebase Product(s)
Messaging
Targeted Platforms
iOS
Relevant Log Output
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
snippetThe text was updated successfully, but these errors were encountered: