[firebase_messaging] iOS 13 push notification NOT working
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.
- in Flutter Stable 1.9.1, push notifications do not appear on my iOS 12.4.1 device, when the always worked before on older flutter versions.
- iOS 13 device does not receive push notifications at all
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.
@khainhero
The issue at https://github.com/flutter/flutter/issues/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 did this problem occur because of Channel stable, v1.9.1+hotfix.5 ?? because #41180 is saw there is people don't get this issue on Flutter (Channel master, v1.10.6-pre.29)
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
<key>FirebaseScreenReportingEnabled</key>
<true/>
<key>FirebaseAppDelegateProxyEnabled</key>
<true/>
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: I've solved the problem with some changes:
- FirebaseAppDelegateProxyEnabled from bool NO to string NO
- I change my flavor setting with following this link https://medium.com/@matt.goodson.business/separating-build-environment-configurations-in-flutter-with-firebase-doing-it-the-right-way-c72c3ad3621f.
- Adding pod 'Firebase/Messaging' to Podfile
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.
- FirebaseAppDelegateProxyEnabled
@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?
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.
It does not work for me...
@AlexBacich add FirebaseAppDelegateProxyEnabled to your Info.plist.
I add podfile for configuring FIRApp on my AppDelegate.m, so I have to add :
@import Firebase;
and
[FIRApp configure];
before GeneratedPluginRegistrant.
Don't forget to turn on Background Modes and check background fetch, remote notifications.
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.
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:
{
"from": "441854012104",
"id": "2",
"notification": {
"title": "this is a title",
"body": "this is body"
},
"type": "news",
"click_action": "FLUTTER_NOTIFICATION_CLICK"
}
Yesterday same push (same CURL for sending) had different format:
{
"from": "441854012104",
"aps": {
"alert": {
"title": "this is a title",
"body": "this is body"
}
},
"data": {
"type": "news",
"id": "2",
"click_action": "FLUTTER_NOTIFICATION_CLICK"
}
}
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 : FCM messages iOS Push payload
@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. I don't believe in conspirancy but it seems sometimes FCM is sending requests in different format.
@AlexBacich hehe... sorry, I don't know why you get different payload then :( Do you have the same problem when sending test push notifications from Firebase Messaging with a given token ?
@nashfive yes, problem is exactly when sending with specific push token.
Is there any workaround for this issue?