Skip to content

[firebase_messaging] Dart side callbacks for FCM are not called on iOS if a message has a notification field #1644

@njovy

Description

@njovy

Describe the bug
Callbacks for Firebase Messaging are not called if a fcm message has a notification field.
If a fcm message is data-only message, fcm callbacks works fine.

As liri2006 stated, 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.

This issue started to happen when I updated Flutter SDK to 1.12.13 from 1.9.1. I noticed FlutterAppDelegate implements UNUserNotificationCenterDelegate with the version I am using. As data-only FCM messages work fine, maybe this pull flutter/engine#9864 causes some conflicts with the FCM plugin.

I don't think this issue is related to any previous issues but people kept commenting this issue on previous issues. I've confirmed that this happens on iOS12 and iOS13. I couldn't test other lower versions as I don't have a real device running lower. Please fix this as FCM is the most important feature!

[✓] Flutter (Channel beta, v1.12.13+hotfix.6, on Mac OS X 10.14.4 18E226, locale en-KR)
 
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.0)
[✓] Android Studio (version 3.5)
[✓] IntelliJ IDEA Ultimate Edition (version 2019.2.3)
[✓] Connected device (1 available)

Above is a flutter doctor output and I am using firebase_messaging 6.0.9.

Metadata

Metadata

Assignees

Labels

impact: crowdAffects many people, though not necessarily a specific customer with an assigned label. (P2)plugin: messagingtype: bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions