FCM notification ID while user is outside of the App #6746
Unanswered
LosDanieloss
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.
-
Hello,
I'm wondering what Firebase Cloud Messaging uses as notification ID when App is in the background or in killed state. Not sure if it's only Android thing or iOS is similar.
I'm asking about it because I'd like to implement notifications in my App that would allow the Backend to tell the App if notification should be updated or new one should be created. I'm aware that FCM accepts "tag" in "notification" object. But that "tag" is not passed to Flutter plugin upon receiving new message when App is in foreground. I'd say we could easily mitigate that one by simply duplicating it in "data" part of push payload.
But that won't solve the problem since on Android id & tag both must match to tell the system that it should update notification rather than create new one. And I wasn't able find how FCM calculate this id when App is in background.
Tried different hashCode (message, senderId, messageId, from, threadId, collapseKey, message.notification.android) but haven't combined them. No luck with that.
I'm aware that switching to only "data" payload should do the trick but for compatibility reasons would like to avoid it.
Anyone?
Beta Was this translation helpful? Give feedback.
All reactions