let messages = {
registration_ids: tokenId,
notification: {
title: 'WebServer',
body: 'Message from center'
},
data: { result: { type: 'add', data : 'New Record' }, sender: {'first_name': 'James', 'last_name': 'Antony' } },
};
fcm.send(messages, function (err, response) {
if (err) {
return err
console.log("Something has gone wrong!", err);
} else {
console.log("Successfully sent with response: ", response.results);
}
});
Can we send object inside data i.e result can supply type and message.
If I put inside object it does not send notification but if I do toString() it does work but at mobile end it shows [object][object].
How can we Make it correct.