-
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
[Flutter Messaging] Adding onBackgroundMessage causes 'null pointer dereference' #144
Comments
The same error for me |
same here |
This is my NotificationHandler class. I disable normal notifications completely and only send background messages and populate them on the device. (only tested on android).
My implementation requires, that you are sending only background messages! If you are sending out a firebase push with the notification payload, it is not working (displayed but the background handler is not being called). This is a notification with the notification payload, it will never trigger the backgroundNotficationHandler: This one has no notification payload and will trigger the backgroundNotificationHandler: Sending out with: |
same issue happens for me
|
Looks like this issue is resolved on the Flutter master channel, i.e., switching to the Flutter master channel resolved the issue for me. When will the fix make it to the stable channel ? |
The same error for me |
Hi @ChrisOwen101 |
Hi guys, Any update on this? |
Describe the bug
When I trying to implement
onBackgroundMessage
in FirebaseMessaging it triggers this error when building for Android (I can't test on iOS):I have my
BackgroundMessageHandler
defined in a top level dart file as per the details in the docs.Configuring the FirebaseMessaging SDK:
The handler:
If I remove the line
onBackgroundMessage: myBackgroundMessageHandler
then the app builds successfully.Interestingly notifications are being received properly but I can't open the app as it crashes on start up.
Relevant Flutter Doctor:
To Reproduce
Covered above
Expected behavior
The app should build successfully
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: