FirebaseMessaging.onMessageOpenedApp.listen not working #8273
-
I am using firebase messaging in app, everything works fine but on background notification tap, this method does not works.
when I save the code then sometimes in log
|
Beta Was this translation helpful? Give feedback.
Replies: 14 comments 12 replies
-
same issue here |
Beta Was this translation helpful? Give feedback.
-
I have the same issue, apparently it is not working, |
Beta Was this translation helpful? Give feedback.
-
any solutions here? Thanks! |
Beta Was this translation helpful? Give feedback.
-
same issue here |
Beta Was this translation helpful? Give feedback.
-
Same issue too with flutter version 3.3.0-0.0.pre. I'm on macOS 12.4 with AndroidStudio version 2021.1. There is a solution ? |
Beta Was this translation helpful? Give feedback.
-
what's the latest working version to avoid this issue?
|
Beta Was this translation helpful? Give feedback.
-
same issue too! I did nothing but suddenly stopped working on both ios/android recently. what's going on? |
Beta Was this translation helpful? Give feedback.
-
I removed the following statement
FirebaseMessaging.instance.setForegroundNotificationPresentationOptions and
it seems to work again on android. Unfortunately on ios I still have
configuration problems so I can't test for the moment, I will do it when I
get back from vacation.
Cordialement,
Alexandra Pietri
Le lun. 8 août 2022, 01:52, Jayden Jung ***@***.***> a écrit :
… same issue too! I did nothing but suddenly stopped working on both
ios/android recently. what's going on?
—
Reply to this email directly, view it on GitHub
<#8273 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADM4CEEGFXIZOR364MKC6WLVYBD5NANCNFSM5QUVHMNQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I solved this issue from check platform when create android channel. |
Beta Was this translation helpful? Give feedback.
-
I got it, this issue is not about the code. This happened because your app is in foreground when you fire the notification, |
Beta Was this translation helpful? Give feedback.
-
In my case, the issue was not in the code. The issue was from the server side from where I was receiving notifications in flutter app. I needed to add under given line in the server-side body of the notification. and in your manifest just add following code: |
Beta Was this translation helpful? Give feedback.
-
I hope it will be helpful.
Then somewhere in the application for example in initState method try to call the payload.
Be aware that flutterLocalNotificationsPlugin is properly initialized in main(). |
Beta Was this translation helpful? Give feedback.
-
I'm also facing the remote message navigation issue. FirebaseMessaging.onMessage.listen( Both not working on IOS |
Beta Was this translation helpful? Give feedback.
-
import 'package:firebase_messaging/firebase_messaging.dart'; class MessagingService { Future init() async {
} void _handleNotificationClick(RemoteMessage message) {
} FirebaseMessaging.onMessageOpenedApp.listen is not working when app is open, and on tap of notification bar |
Beta Was this translation helpful? Give feedback.
In my case, the issue was not in the code. The issue was from the server side from where I was receiving notifications in flutter app. I needed to add under given line in the server-side body of the notification.
"click_action": "FLUTTER_NOTIFICATION_CLICK",
and whole code is:
DATA='{ "notification": { "body": "this is a body", "title": "this is a title" }, "data": { "att1": "value..", "att2": "value..", "click_action": "FLUTTER_NOTIFICATION_CLICK", }, "to": "<FCM TOKEN>" }'
and in your manifest just add following code:
<intent-filter> <action android:name="FLUTTER_NOTIFICATION_CLICK" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter>