Skip to content

🐛 [firebase_messaging] initialMessage should be kept, even if it doesn't contain [Notification] part #12370

Open
@DusanPeric44

Description

@DusanPeric44

I'm making a Flutter app that includes in-app messaging, and I'm managing my push notifications with Firebase.
I also have non-message notifications that are sent via Firebase too.

I need a different look for message notifications (MessagingStyleInformation), so I handle them in background and terminated state by not sending Notification part in a RemoteMessage from backend, and then using a global function in my app to handle showing appropriate notification style. But there is a problem, now when I click on the push notification for chat and my app is in terminated state, it cannot redirect to a chat screen because FirebaseMessaging.instance.getInitialMessage() returns null.
image

This is the code in my home screen:
image

It works fine with my non-chat push notifications (getInitialMessage will return an actual RemoteMessage that came, because it contains Notification part) , but as I mentioned before, it doesn't work with message push notifications.

Can this condition for Notification part be removed, so that Firebase Messaging plugin can remember all remote messages that came?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions