I am trying to add push notifications in my React app with Node.js but in response it gives result as InvalidRegistration
app.post('/subscribe', (req, res) => {
var senderToken = req.body.to;
regTokens.push(senderToken);
sender.send(message, { registrationTokens: regTokens }, function (err, response) {
if (err) console.error("err",err);
else console.log(response);
res.send();
}
);
});
response : { multicast_id: 5402766225339800000, success: 0, failure: 1, canonical_ids: 0, results: [ { error: 'InvalidRegistration' } ] }