How to use rich text notification, i want to send image that display event if app is in background.
so i want to add "mutable_content": true,
my current code is as below.
var message = { //this may vary according to the message type (single recipient, multicast, topic, et cetera)
to: existToken.device_token,
// collapse_key: 'your_collapse_key',
notification: {
title: 'title',
body: 'New Promotion.'
},
data: { //you can send only notification or only data(or include both)
title: post.title,
image: 'image_url'
}
};
fcm.send(message, function(err, response){
if (err) {
console.log("Something has gone wrong!");
} else {
console.log("Successfully sent with response: ", response);
}
});
How to use rich text notification, i want to send image that display event if app is in background.
so i want to add
"mutable_content": true,
my current code is as below.