Reputation: 331
I am using Flutter for my code. For push notification, I am using Firebase Push Notification ("firebase_messaging" version 9.1.3).
I am facing the following issue:
Below is my code that listen to the message (referencing from Flutter example).
FirebaseMessaging.onMessageOpenedApp.listen((RemoteMessage message) {
//Process received message
_processMessage(message);
});
What am I missing to enable the app to receive the notification payload if it launched fresh.
Upvotes: 0
Views: 1531
Reputation: 6353
As far as I remember, onMessageOpenedApp
is only triggered when the app is launched from the background state.
For receiving notification payload when launching from the terminated state, you have to use getInitialMessage()
method.
More on that can be found here.
Upvotes: 1