-
Notifications
You must be signed in to change notification settings - Fork 4k
Firebase messaging onResume and onMessage broken on iOS since Flutter 1.7.4 #1056
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
Comments
The issue at flutter/flutter#36201 has been closed and moved here. Future collaboration on this issue will be done here. |
One note from my side on this issue: Runnning: [✓] Flutter (Channel stable, v1.9.1+hotfix.2, on Mac OS X 10.14.6 18G95, locale en-DE) |
We've solved the issue for us. Our project is rather old for a Flutter project at this point; we've been at work on it since July 2018. I gave up trying to solve the issues on the iOS side and created a new project, using Swift (unlike our actual project, which used Objective-C still). I then set the same configuration we have in our actual project (and of course copied over all Dart code), and now notifications work, on all versions. I'm not sure the issue should be closed since we essentially just sidestepped it. |
Also having this issue. Works flawlessly on android, but on iOS it never gets called. Running on 1.9.1+hotfix.4 I believe this: |
Hi guys, Any solutions to this yet ? |
This issue does seem to be related to #121 which should resolve it. |
EDIT: #121 does fix the issue. I had an error elsewhere causing my code in onMessage not to execute. Hopefully it fixes the rest of your issues too! |
Ahh I just found out this issue until now I thought I've been doing wrong as it works intended on Android. |
Closing now that #121 is merged. |
@kroikie Is there any additional steps that should be performed to fix this (besides ones from package page)? I'm still having this issue - data message are consumed as expected, but notification messages are ignored by onMessage (or any other callback) if app is in foreground. They are displayed normally in notification tray if app is in background, but callbacks are not fired if tapped. I'm using firebase_messaging 6.0.1 and flutter 1.12.13+hotfix.1 from beta channel. (Although I've tried plugin version straight from github with same result) |
@kroikie I thought this issue is fixed with adding below but I don't get any callbacks after update to 1.12.13+hotfix.6. This should be reopened.
|
I am also on 1.12.13+hotfix.6 and facing the same issue. None of the callbacks are working on actual device in foreground iOS 13.3. |
I have the same issue as @njovy and @WahibAbdul. |
I have the same issue as @njovy and @WahibAbdul. |
Same behaviour here with Flutter 1.12.13+hotfix.5 and iOS 13.3. - onResume and onMessage don't fire. Please reopen @kroikie @BondarenkoStas 🙏 |
Same behavior here. on |
I have the same problem with:
Removing those lines and it works again |
@CasperPas, everybody: What would be possible other implications when removing that code? |
it's weird because in the documentation it says to put this line it doesn't make sense |
Because on previous versions it was required. 6.0.1 and specifically that line from the documentation fixed my app's notifications. I was running flutter 1.9.1 at the time of the fix. I'm not sure what's caused it to break in the latest version of flutter, but it definitely was supposed to be there when the change was pushed. |
Removing those lines make it work for me. Though as @Cascoid says adding those lines fixed my app notifications when I used 6.0.3, before adding those lines I did not receive any notifications at all... To summerise:
I am running:
|
@semone This seems to have solved the issue for me too. I have no idea what these lines of code are supposed to do and if removing them will have any negative impact. Anyone knows? I tested with Firebase messaging 6.0.9, iOS 10.3.4, and Flutter 1.12.13+hotfix.5 |
Removing these lines doesn't solve my problem.
I have the next AppDelegate.m:
|
You saved me! |
if somebody have this issue despite removing this code if #available(iOS 10.0, *) {
UNUserNotificationCenter.current().delegate = self as? UNUserNotificationCenterDelegate
} Than check if you are using in your project |
it was good if the Firebase team updated this in the documentation
|
To build on @michcio53's answer, if you see |
I am not using flutter_local_notifications But I also had the same issue. As everyone mentioned, removing these lines solved the issue But since the official documentation is against this, I really don't know is there any other side effects for removing this. |
In what file i need to do this? |
On Flutter's dev channel (and all other channels), Firebase Messaging's onResume and onMessage callbacks are broken on iOS as of 1.7.4. We have done extensive testing, and it works fine with v1.6.3, and even v1.6.7. onLaunch works fine, and all callbacks work fine on Android. The callbacks are not called at all, and the following error can be found in the iOS logs:
Every now and then it shows
error 1
instead oferror 4
. This error is terribly documented online (not at all), but I recognise it from when we had our iOS app configurated wrong for push notifications. Our configuration is fine now. We build via a build server, so we still have all the logs. We built a version on June 20st (from now on referred to as A), and a version on June 21st (B). A was v1.6.3, B was v1.7.4. We've since tested v1.6.7, and that version is fine too. Version A calls the callbacks and works fine. Version B does not. The issue is not related to our code since on our current HEAD, the callbacks still only work < v1.7.4.Now, we have had to revert back to Flutter v1.6.7, meaning we no longer have access to app bundles and TransferableTypedData, which is, of course, a major blocker for our work.
Flutter version for A:
Flutter version for B:
Firebase messaging version: 5.1.0, but applies to every version since at least 5.0.1 (that's as far as we went)
The text was updated successfully, but these errors were encountered: