Closed uropsm closed 4 years ago
in fcm.js, It looks that this part causes this issue.
res.on('end', respond); res.on('close', respond);
Same issue Please help !
response: { "message": "Point send successfully" } // calling twice
if (err) {
var data = {
status: "false",
response: { "message": "Notification not send successfully" }
};
res.json(data);
} else {
var data = {
status: "true",
response: { "message": "Point send successfully" } // calling twice
};
res.json(data);
}
Fixed on this pr https://github.com/jlcvp/fcm-node/pull/52
fcm.send's callback is called twice. please help!
fcm.send(message, function(err, response){ if(err) { console.log("Something has gone wrong!") } else { console.log("Successfully sent with response: ", response) << called twice! } })