Skip to content

[firebase_messaging] Background messages not delivered in versions newer than 6.0.3 #1763

Closed
@LinusU

Description

@LinusU

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:

I/flutter (20210): Unable to handle incoming background message.
I/flutter (20210): NoSuchMethodError: The method 'call' was called on null.
I/flutter (20210): Receiver: null
I/flutter (20210): Tried calling: call(_LinkedHashMap len:1)

This occurs even if my handler is just a simple print statement, thus the null.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:

  1. Add firebase_messaging version 6.0.3
  2. Add a background handler that prints something to the log
  3. See that the message is received
  4. Upgrade to the latest firebase_messaging version
  5. See that the message is no longer received

Expected behavior
The message should be received with both versions.

Additional context
n/a

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