-
Notifications
You must be signed in to change notification settings - Fork 4k
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
[firebase_messaging] iOS 13 push notification NOT working #1041
Comments
The issue at flutter/flutter#41180 has been closed and moved here. Future collaboration on this issue will be done here. |
i got same issue ,,, notification only work in foreground,,,, in background not working... there is no notification in tray.. |
@kroikie |
I can confirm this. Notifications are working fine on Android but on iOS all messages are only working in foreground like data messages. They are sent to "onMessage" but in the background nothing happens. When the app is opened again, the missing notifications are sent to "onMessage". The intention of "notification messages" was to pop them up even when the app is in background or terminated. That doesn't seem to work in iOS at the moment. |
Make sure info.plist is configured
|
I'm using flutter stable v1.9.1 and master v1.10.6 and it seems not working at all on ios 13 or 12.4. and yes in android it's working normal. |
Not working in android pie up to (emulator) |
I am having this issue on iOS13 as well. |
I have the same issue as well on iOS 13. |
Update:
Now from console, Push notification had appeared again. |
FYI, I've created a simple Flutter app (1.9.1+hotfix.6) with firebase_messaging, and it works as expected on both Android and iOS 13, while the app is in the foreground or the background or killed. I didn't do anything special, besides following the regular steps in the README. |
@dopefaceee , can you please explain more on your solution? I don't quite understand what exactly you did for each of steps. Where FirebaseAppDelegateProxyEnabled is located? Why you added pod to Podfile if it's managed by pubspec? What exactly was changed in regards of flavoring? |
It does not work for me... |
@AlexBacich add FirebaseAppDelegateProxyEnabled to your Info.plist. |
Surprisingly, at some point push notifications DID START coming properly. I was able to get normal notifications in background. And then again they STOPPED coming today. Weird thing about this - how messages are coming. Today format is something like this:
Yesterday same push (same CURL for sending) had different format:
I just don't get it. It's so random. |
@AlexBacich what you're describing seems to be simply the difference between an Android FCM message and an iOS push : |
@nashfive ok, let's take into consideration it's the difference between an Android FCM and iOS Push. But how can I control it? I'm sending exactly the same test request to legacy FCM API and get different message format on my device. |
@AlexBacich hehe... sorry, I don't know why you get different payload then :( |
@nashfive yes, problem is exactly when sending with specific push token. |
Is there any workaround for this issue? |
For me it was problem with wrong App ID in firebase console, now notifications work. |
@IvanOnishchenko is it working on iOS 13? |
@OsamaFelFel Yes, when I send it from firebase Cloud Messaging console, but it still doesn't work for personal notification, when one user sending messages to other. |
has anyone tested notifications on ios 14? |
Working fine for me so far! |
It's not working for me. |
iOS 14, background notifications with FCM doesn't work for mr as well. Foreground notifications working as expected. |
Try my fix here for swizzling to resolve the background notifications: #3395 (comment) |
Didn't work for me :/ Tried to disable swizzling.. didn't help as well. |
You can use that exact snippet, just comment out the parts about auth. If you disable swizzling, you must implement the calls into the firebase lib as my example does. |
Could you please copy here what exactly should be written? |
I tried to put this code, // https://firebase.google.com/docs/auth/ios/phone-auth#appendix:-using-phone-sign-in-without-swizzling
|
I had the Push Notifications permission on iOS plist off, which is weird because I'm pretty sure I turned it on. Together with @acoutts solution, it worked. Thanks. |
Based on everyone who IS getting their app to work, and that it seems to be non-reproducible, is this a bug, or just configuration error? |
The library works- I know because i've got it working in my app, and I've personally setup the included example app and it also works. The library does have at least one bug though, like the one where data messages are broken when used in combination with Firebase Auth and you have to disable swizzling / manually handle swizzling (my issue / workaround here: #3395 (comment)) to make it work. That being said, I know they have a rework of firebase_messaging on the roadmap so I think they'll have everything fixed after that. I personally think most of the issues reported in this thread are configuration errors, and I've not seen anyone provide an example project which demonstrates that it's broken. Until someone can do that, then this issue wont get much attention from the Invertase team. |
@acoutts My application uses Firebase Database Realtime, Firebase Auth, Firebase Messaging. I have proceeded to perform the steps you indicate but it throws me a compatibility error, I still cannot get the notifications to work on iOS. |
@DomingoMG see my comment there- just to confirm, you will want to increase your project to iOS 9 due to Flutter 1.22 now requiring that anyways, so it's best to make that change. |
I used the solution above and notifications are working for me now. |
For those getting foreground notification but not background, make sure you set |
How to set it from Firebase? |
I had the same Issues. In my case its been solved by checking the following in Xcode: Runner -> Signing & Capabilities -> Make sure that in all categories (All, Debug, Release, Profile) Background Modes (with Background fetch & Remote notifications) and Push Notifications are added to Capabilities. After that everything worked without setting any headers in Firebase. (Testing on real iOS device) Fluter 1.22.0 |
I'm getting nervous |
can you share us the steps to turn on Push Notifications permission ? |
void iOSPermission() { |
in any file add this code |
please have you had any success? I have the same bug, I receive notifications only on foreground of iOS 13 and 14 but works fine on iOS 11. |
please can you show a detail of the permission you added to plist |
I had the same issue. What finally fixed it for me was to make sure that in firebase cloud messaging settings that I uploaded the p8 APN authentication key. Wala! For more details I followed this medium article. Also please make sure in your apple developer portal that your app identifier has apple push services enabled. |
FCM is being reworked -- soon all this setup may be obsolete |
Hey all 👋 As part of our roadmap (#2582) we've just shipped a complete rework of the If you can, please try out the dev release (see the migration guide for upgrading and for changes) and if you have any feedback then join in the discussion here. Given the scope of the rework I'm going to go ahead and close this issue in favor of trying out the latest plugin. Thanks everyone. |
Push notification does not seem to work on iOS 13 device nor on my iOS 12.4.1 device on stable 1.9.1.
Seems to be 2 separate issues as well.
Some reading available from oneSignal
https://onesignal.com/blog/ios-13-introduces-4-breaking-changes-to-notifications/
I updated my device OS(personal) version to 13, cannot further test without downgrading it back to 12.4.1. and I do not have a spare iPhone available.
Thank you
Also for other users, can you please input our own issue related to the mentioned.
Things such as current physical device iOS software version and flutter channel along with its version number. so we can compile a list of where in flutter and iOS(versions) things just stopped working.
Push notification is and should be very ### critical part of a persons or companies application when used right. I hope we can address the issues and come up with a solution.
The text was updated successfully, but these errors were encountered: