目前我正在试图发送一个PushNotification
到Device Group
使用FCM
与Firebase Cloud Functions
的帮助,但一旦通知发出,它的代码200
返回,但失败:火力地堡FCM错误:“InvalidRegistration”
SUCCESS response= {
multicast_id: 8834986220110966000,
success: 0,
failure: 1,
canonical_ids: 0,
results: [ { error: 'InvalidRegistration' } ]
}
这是我用来发送此通知的代码...我错过了什么?
const options = {
method: 'POST',
uri: 'https://fcm.googleapis.com/fcm/send',
headers: {
'Authorization': 'key=' + serverKey,
},
body: {
to: groupId,
data: {
subject: message
},
notification: {
title: title,
body: body,
badge: 1,
},
content_available: true
},
json: true
};
return rqstProm(options)
.then((parsedBody) => {
console.log('SUCCESS response=', parsedBody);
})
.catch((err) => {
console.log('FAILED err=', err);
});
凡JSON值title
,body
,subject
,message
是String
这实际上并没有回答这个问题,我也从一个节点JS后端使用完全不同的方式获得相同的错误。 – mic