Radovan
Radovan

Reputation: 31

FirebaseMessaging.onMessageOpenedApp.listen is not triggered... I use last version of firebase_messaging

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

Answers (1)

Bauroziq
Bauroziq

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

Related Questions