[Firebase_messaging] Double notification appear in release mode for some device (Flutter android) #18127
Unanswered
matteoberla
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi every one, I'm trying to handle notification in my Flutter App, I'll start showing all the code and then telling you more about the problem I'm facing.
Inside my
main()function :FirebaseApi.dart (Handler class with all the functions called to handle notification):
Payload sent from my php backend:
The problem I'm facing:
-On iOS everything works (or at least for all the device I've been able to test)
-On android in debug mode works fine in any device, but on release mode I've noticed that sometimes a double notification is showed.
It happens just for a device I'm testing: One Plus 8t, Android 14. Oxygen OS KB2003_14.0.0.1311.
When the app is killed or in background a double notification is sent (just in this device, just in release mode, i've tested in debug mode and it works just like any other device), while in any other device I've tried it's not happening.
I've read the documentation talking about not sending both "notification" and "data" in the payload, but it has worked without any problem and if I don't send one of them I've other problems while handling the notification actions or the notification is not showed at all.
NOTICE THAT:
Inside
sendLocalNotificationthere's aif (Platform.isIOS) return;this because in the past I've noticed that iOS was already creating a notification in some cases by itself, and thus the local notification was not needed, if I hadn't add thisreturna double notification on iOS would have been sent, but on iOS every device had this behavior.I'm attaching some debug logs to show you what is happening in debug, unfortunately I'm not able to save the same logs on release mode to see what is happening.
Any help would really be appreciated.
Beta Was this translation helpful? Give feedback.
All reactions