I get the notification and method in FirebaseMessaging that the onMessage is triggered, I see the data, but since they first pass through the native code, when I minimize the application and try to send a message, it immediately appears, I need to do that in some cases if I passed some parameter of the bool type, I did not show them.

Between this, when the application is open, I don’t see any notifications at all, but the onMessage method works. I can try to get the data in onMessage and then show the local notification using flutter_local_notifications, but then this method will not work on ios since local notifications are not allowed.

The question is, how can I first get the data from the notification, and after parsing the data from the notification, in some cases, can I show the notification? I do not see a way out how to do this natively?

1 Answers

0
flarkmarup On

A possible solution is to utilise the native plugin for Firebase Messaging and then handle the logic in onMessageReceived (Android documentation). Then you can force your app to always show notifications if you build the notification yourself. An article has been posted about on Medium it as well. I do not know if you need the same behaviour for iOS or if it acts as intended now?