Closed devesh2605 closed 6 years ago
The official FCM Documentation tell us that if there's any failure, the field failed_registration_ids
is set with a list of failed ones.
The response message will be like this:
{
"success":1,
"failure":2,
"failed_registration_ids":[
"regId1",
"regId2"
]
}
fcm.send(message, function(err, response) { if (err) { let errorData = JSON.parse(err); let statusData = { 'success' : errorData.success, 'failure' : errorData.failure } updateStatus(pushId, statusData.success, statusData.failure); logger.error = 'Notification Not Sent To Few Users'; res.status(400).json(statusData); } else { let resData = JSON.parse(response); let statusData = { 'success' : resData.success, 'failure' : resData.failure } updateStatus(pushId, statusData.success, statusData.failure); logger.info(response); res.status(200).json(response); } });
Is there any way to find out the list of registration_id's for which the notification is failed!