flutterfire icon indicating copy to clipboard operation
flutterfire copied to clipboard

🐛 [firebase_messaging] Notification is not displayed when in background

Open cturn-dev opened this issue 4 years ago • 5 comments

Bug report

In android release mode, when compiled with the following options:

flutter build apk --release --split-debug-info=/tmp/sym --tree-shake-icons

In background, app cannot display notifications but logs this error:

Dart Unhandled Exception: NoSuchMethodError: No top-level getter '_firebaseMessagingCallbackDispatcher' declared.

My workaround: @pragma('vm:entry-point') void _firebaseMessagingCallbackDispatcher()


Flutter doctor

Click To Expand
[✓] Flutter (Channel stable, 2.10.3, on Manjaro Linux 5.15.28-1-MANJARO, locale fr_FR.utf8)
[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Linux toolchain - develop for Linux desktop
[✓] Android Studio (version 2021.1)
[✓] Connected device (2 available)
[✓] HTTP Host Availability


cturn-dev avatar Mar 18 '22 13:03 cturn-dev

@cturn-dev Does it also occur in debug mode too ? ie, flutter build apk --debug --split-debug-info=/tmp/sym --tree-shake-icons.

Also, can you try the same on latest master and see if issue still persists ?

darshankawar avatar Mar 21 '22 10:03 darshankawar

Does it also occur in debug mode too ? ie, flutter build apk --debug --split-debug-info=/tmp/sym --tree-shake-icons.

No

Also, can you try the same on latest master and see if issue still persists ?

Tried latest master, same issue

cturn-dev avatar Mar 21 '22 15:03 cturn-dev

@cturn-dev Can you provide us a minimal reproducible code sample that we can use and run to verify this ?

It looks similar to https://github.com/FirebaseExtended/flutterfire/issues/8305. Are you sending a notification message or a data message ? Can you provide a sample payload you are sending ?

darshankawar avatar Mar 22 '22 10:03 darshankawar

Hey @cturn-dev. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot avatar Mar 31 '22 01:03 google-oss-bot

Since there haven't been any recent updates here, I am going to close this issue.

@cturn-dev if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

google-oss-bot avatar Apr 11 '22 01:04 google-oss-bot