I used flutter with FCM and i found FirebaseMessaging.onMessageOpenedApp.listen is only worked app is not terminated.
I seached stackoverflow and i found the answer.
The full story is below.
Flutter - FirebaseMessaging.onMessageOpenedApp.listen is not triggered
I am using: flutter version 2.2 firebase_messaging: ^10.0.2 I receive push notification, then click on it and the app is opened. Then I do not see FirebaseMessaging.onMessageOpenedApp.listen gett...
stackoverflow.com
For the first question:
To view the logs from your app, you can use the 'Logcat' tab in Android Studio or IntelliJ:

For the second question:
If your app is terminated and you want to receive a notification click callback, you should use:
FirebaseMessaging.instance.getInitialMessage().then((message) {
if (message != null) {
// DO YOUR THING HERE
}
});
, because according to the Flutter team's comments for onMessageopenedApp function:
/// If your app is opened via a notification whilst the app is terminated,
/// see [getInitialMessage].
'개발 > Flutter' 카테고리의 다른 글
Get hash key for Mac, (Facebook , Kakao) (0) | 2022.02.10 |
---|---|
Why we use Key in flutter widget? (0) | 2022.02.10 |
flutter FCM 좋은 글 (0) | 2022.02.02 |
UCG update 문제 (0) | 2022.01.31 |
How to setting Theme of flutter circular Progress Indicator bar Color (0) | 2022.01.31 |