Reputation: 31
I use Flutter (Channel stable, 2.8.1) and firebase messaging: 11.2.4, trying to use FirebaseMessaging.onMessageOpenedApp.listen for backgorund mode but this method in my case does not register any changes, also tested the code from the example, but it didn't work even then. https://pub.dev/packages/firebase_messaging/example
Upvotes: 0
Views: 1153
Reputation: 1231
Use onMessageOpenedApp
only when the application is in the background, not foreground or terminated.
A Stream event will be sent if the app has opened from a background state (not terminated).
See onMessageOpenedApp for details.
To handle click your push notification in foreground & background, you can try here.
Upvotes: 1