-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 [firebase_messaging] FirebaseMessaging.onMessageOpenedApp.listen((message){} triggering more than once #7243
Comments
@pranav-asthi |
pubspec.yaml
|
|
The issue is some what similar to that of 4188 but the handler is different here |
@pranav-asthi
When you trigger onMessageOpenedApp, it also need to listen to Also, just to confirm, can you try the official plugin example and see if you get same behavior ? |
It happens only when the app is in background state. Yes ,the getInitialMessage() working properly . |
In this handler, the navigation and printing happens twice |
Thanks for the update. Seeing the same behavior using latest plugin version on stable and master. stable, master flutter doctor -v
|
similar / related : #4188 |
I don't know if related. |
Faced the same issue. static Stream get onMessageOpenedApp => ` |
I had the same problem, also with FirebaseMessaging.onMessage.listen. I fixed it by putting the StreamSubscription return by the listen function in a variable. Then, before I call FirebaseMessaging.onMessage.listen, I check if the subscription already has been set, if yes, I don't make the call. if(_onMessageSub == null) { Otherwise, it seems that the call to .listen creates multiple subscriptions and in my case it was triggered up to 6 times. |
@vincepunkrock Could you please share a bit more code? Does the subscription prevent multiple calls? |
@abigotado Here how I have fixed this issue for me
|
@Bhagat8533 Thank you very much! |
Hey @pranav-asthi, which platform are you experiencing this on? |
i fixed it a long time ago and i forgot to close this issue |
FirebaseMessaging.onMessageOpenedApp.listen((message){} triggering more than once for a single notification
The text was updated successfully, but these errors were encountered: