Closed jonathan-chin closed 7 years ago
This collapse_key option is for notifications that wasnt sent yet. (i.e.: notifications of new versions available. If you release a version 1.0 and then fix a bug and relase a 1.0.1, you
ll want only the 1.0.1 notification to be sent to those that didn`t received the 1.0 notification yet.)
For a functionality like facebook messenger or whatsapp messenger where the number of new messages are shown, consider send data-only objects through push and build the notification on your receiver service.
Thanks @jlcvp I actually figured out the functionality I needed; it was indeed the tag key, though I don't think fcm-node properly documents it:
let message = {
to: token,
notification: {
tag: "new_messages",
title: `You have ${count} new message${count == 1 ? '' : 's'}`,
body: `Click to read them!`
},
data: {
type: "chat"
}
};
this.fcm.send(message, (error, response) => { /* etc */ })
@jonathan-chin, tag option only works for Android or Browser , any iOS idea ?
I'm new to push notifications. It seems like what I really want is collapse_key, where the user's notification tray combines or overwrites a notification. but, it only works when the receiving device is offline?
how do I get that functionality also when it's online? some documentation online mentions FCM supporting a
tag
key, but it's not apparent if I can use it with fcm-nodewhat are my options? thanks!