-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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/unknown] The operation couldn’t be completed. Invalid fetch response, expected 'token' or 'Error' key #6830
Comments
Same Bug from here! It starts this night. |
In my case there was no changes at all, no pod install, nothing, some users that have the application from the App Store just messaged us mentioning they could not use the app, I then tried on the iPhone I had with me using iOS 12 and everything worked fine, so then I tried on the Simulator with iOS 16.2 and to my surprise the app was stuck on messaging().getToken() like you mentioned. Though this is a very strange case, I thought this was specific to the version 16.2. But one of my colleagues with an iPhone X on iOS 16.2, tried the app and told me nothing was wrong on his end. |
This comment was marked as duplicate.
This comment was marked as duplicate.
Sorry, just wondering, if this ticket can get some triage priority? As mentioned and confirmed by several reports, this issue seems to have started without any changes to the affected apps. So there is nothing to roll-back/undo in order to avoid it. Based on at least one report, it seems to have started to affect users in PROD, i.e.
|
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
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 error on iOS, which we had never seen "surfaced" to our error reporting:
Again, just for context if that helps narrow down how the |
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
Also reproduced in the native iOS Firebase SDK, iOS 16.1 |
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
Happens to us as well, when trying to subscribe/unsubscribe from topics: react-native-firebase 16.4.3, react-native 0.69.3, firebase@9.15.0 |
Error logging is new but I think its just telling you that you can't test the fcm on iOS simulator as indicated in the docs:
If you run the app on a physical iPhone, the error message does not appear |
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
In my case it appears on physical iPhone too. |
This comment was marked as duplicate.
This comment was marked as duplicate.
I had the same problem with "cordova-plugin-firebasex". |
Just to recap the status to date based on what I see in the various responses:
For robustness, we actually ended up deploying a code change to STAGING and PROD, to allow the app to proceed with the app initialization even if the FCM getToken fails, while still reporting a potential error to our Instabug instance for visibility. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as duplicate.
This comment was marked as duplicate.
For anyone experiencing this for now, just add a try catch so that the error doesn't crash the app/stop your processes.
@livnunes I use iOS 13.4. I don't have any other physical devices to test on unfortunately so I cannot test other iOS versions. |
Could be related to the recent change of the native iOS SDK?
https://firebase.google.com/support/release-notes/ios#version_1040_-_january_17_2023 |
It's exactly that |
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as abuse.
This comment was marked as abuse.
Hey there, just a friendly reminder - let's keep things collaborative and on-topic, yes? It appears to. be a firebase-ios-sdk issue and they are aware of it: firebase/firebase-ios-sdk#10679 (comment) I suggest folks follow along on that issue, I'm not sure we will be able to resolve it here at this level Please, please do not post +1s, use reactions instead, unless you have new concrete, reproducible technical information on the problem that a) is not already in the related ticket and b) moves the ticket forward. Thank you! |
Well, I found this issue yesterday. Before :
After : Hopefully this is can help someone who faced same problem like me. |
it is working now in ios simulator, didn't change anything, seems it was an issue with google server. |
I encountered the issue yesterday, but today everything works as expected without changing anything |
Looks like some of the issues on here may be related to a server FCM change - see firebase/firebase-ios-sdk#10679 (comment). It was rolled back last night, for me this fixed the issue. |
Thanks issue is fixed |
Thanks everyone for the patience - this is resolved - temporarily - by firebase team rolling back a server change However, and this is important, there is some necessary change required for us to adopt firebase-ios-sdk 10.4.0, as our e2e test harness here does not pass token-related messaging tests with 10.4.0 That implies that if you are among the small number of react-native-firebase users that use Podfile overrides to specify the firebase-ios-sdk version (always possible as a "just in case" capability) it is not safe to use 10.4.0 yet. So we're not finished here. I'm going to leave this open pending guidance from firebase team on that change |
Current statusIn collaboration with the firebase-ios-sdk team, I/we think these things: After review and some investigation from the firebase-ios-sdk crew, we have some news on the new “No FCM token if you do not have an APNS token” behavior change in firebase-ios-sdk 10.4.0.
Current plansTo move this forward, will likely be a few days though unless someone listening in here wants to override their SDK version to 10.4.0 and try the following: Next steps:
|
Well in my case, it was giving me the FCM token on the first install of the app. And when the app is closed and re-opened, it was failing with this error But if I try to hot reload, by pressing |
@santhosh-umapathi-appymango that's unexpected 🤔 - you might check to see if there is any sort of token delete or invalidation logic in your app anywhere. I'm not aware of why the APNS token would be removed from the app or the FCM subsystem unless done explicitly, but we may be about to learn something based on results of any investigation you perform... |
@mikehardy , Found a way to make it work !! There are no token deletion methods or invalidation logics. I just try to get the permissions first and have a check to see if its granted and then try to get the token. This is the implementation I used, just for iOS simulator, it seems like it tries to get the token as soon as the app starts or strange, but after putting a delay of 2 seconds, I was able to get the token even after the app restarts.
|
Indeed, all of these activities are asynchronous and depend on the network, so 2 seconds likely works well as a heuristic but sometimes it may be 10ms and perhaps it never happens, perhaps better to have a retry loop on messaging().getAPNSToken() (which is local - it depends on the token coming in asynchronously and calling an AppDelegate callback, but Then you can call getAPNSToken in a somewhat tighter loop (maybe every 500ms or something?) with a more slack full timeout (maybe give up completely after 60 seconds and warn user that some functionality will be disabled?), as soon as the APNS token comes in you should be safe to call What do you think? |
@mikehardy Thanks a lot for your suggestion. I implemented it a bit differently, but the idea was from your previous message :). For some reason And I basically kept a retry count to loop the request again in case it failed to get the token on the first 3 tries.
and viola, Push notifications work on iOS Simulators as well as real devices 🚀🚀 |
@santhosh-umapathi-appymango This method didn't work for me... It tries 3 times and errors each time. I even tried with a setTimeout between each... Did you do anything else to make this work? |
Can you share your code snippet and have you completed all the steps on iOS side setup ? And what error do you get ? |
i think, it is your xcode version, if you use xcode 15.2 or highest xcode. you can try after upgrade the mobile device's software(OS) version. Install software(OS) updates on the device. |
Issue
Describe your issue here
As of this morning (EDT), when running our app in the iOS Simulator, we are seeing this Firebase Messaging Error message:
We have made no Firebase or React Native related changes to our dependencies or code base over night.
The only change was locally running
pod install
for a patch version upgrade of a completely unrelated library (react-native-rate) on a working branch. However, even go back to the main branch without the lib upgrade, cleaning, runningyarn
andpod install
creates the new issue on themain
branch as well.The error is thrown on the
messaging().getToken()
invocation.The issue does not replicate on Android it seems.
It is also not currently affecting our deployed environments STAGING and PROD.
However, those environments, did not yet see a build-deploy cycle today. (Last Staging CI Deployment run was 2 days ago).
So if this error is due to some deep iOS lib dependency of RN Firebase, while our
Podfile.lock
does not have any tracked changes related to RN Firebase, we are worried that the issue propagates with the next Deployment runs.Project Files
Javascript
Click To Expand
package.json
:# N/A
firebase.json
for react-native-firebase v6:# N/A
iOS
Click To Expand
ios/Podfile
:# N/A
Relevant snippet from
Podfile.lock
:AppDelegate.m
:// N/A
Android
Click To Expand
Have you converted to AndroidX?
android/gradle.settings
jetifier=true
for Android compatibility?jetifier
for react-native compatibility?android/build.gradle
:// N/A
android/app/build.gradle
:// N/A
android/settings.gradle
:// N/A
MainApplication.java
:// N/A
AndroidManifest.xml
:<!-- N/A -->
Environment
Click To Expand
react-native info
output:react-native-firebase
version you're using that has this issue:13.0.1
We are currently exploring the upgrade path, given the breaking change with
use_frameworks!
introduced in RN Firebase 15.xFirebase
module(s) you're using that has the issue:Messaging
TypeScript
?Y
&4.6.2
React Native Firebase
andInvertase
on Twitter for updates on the library.The text was updated successfully, but these errors were encountered: