-
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] Background messages not delivered in versions newer than 6.0.3 #1763
Comments
Hi @LinusU |
From a discussion in our team chat: this is likely caused by a bug in how we added Android v2 embedding support. See also flutter/flutter#47406, which is showing similar symptoms when running in the background because of a change in the v2 embedding. /cc @bparrishMines |
I am also faced this issue after upgrade .. Please register the plugin like below in Application class for android. Now it's working for me import io.flutter.app.FlutterApplication class Application : FlutterApplication(), PluginRegistrantCallback { |
Any solutions? |
Also can you please expound on the background handler? How are you logging a backgrounded application? |
Note that the comments in this thread shows two different things, one is a user error, the other is a bug:
(edited) => after some more testing, I can confirm that I only see the bug when the message is formatted as in item 1 above. The reason is that with the absence of a notification item in the message, the message will be attempted sent to the background handler. However, WITH the notification item present, the default android message handler will present a regular android tray notification. When the user selects the notification, your app will be resume and the onResume function called as expected. This is probably what most app developers want as you can then react to the message with UI updates as well. However, if you want to silently trigger a background action without any user interaction, you are still hit by this bug. |
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. |
Describe the bug
When upgrading from version 6.0.3 of firebase_messaging our
onBackgroundMessage
handler is no longer called. Instead the following error is printed to the Android log:This occurs even if my handler is just a simple
print
statement, thus thenull.call(...)
doesn't happen in my handler.Here is where the error is logged from:
https://github.com/FirebaseExtended/flutterfire/blob/547674c8b550a0b14ff442a3bd6a2663c6dc7680/packages/firebase_messaging/lib/firebase_messaging.dart#L37-L43
To Reproduce
Steps to reproduce the behavior:
firebase_messaging
version6.0.3
firebase_messaging
versionExpected behavior
The message should be received with both versions.
Additional context
n/a
The text was updated successfully, but these errors were encountered: