接收方未收到通知

时间:2019-09-25 06:43:20

标签: ios firebase google-cloud-firestore firebase-cloud-messaging google-cloud-functions

我正在使用两个Firebase数据库项目。我必须将通知从一个数据库(项目A)发送到另一个数据库(项目B)。我正在通过Cloud函数(在Project-A中)的API调用发送通知,并且必须在IOS设备中接收(从Project-B)。我正在发送通过API调用使用Project-A的SenderId生成的设备令牌,并将该令牌保存在Project-A的数据库中。在Project-A中,我使用云功能向Project-B中的IOS设备发送通知。在Project-A的firebase控制台中,它显示通知已成功发送,但是在接收方,我没有收到任何通知。

有效载荷:

 let payload = {

    notification: {
        title: "Notification Alert",
        body:  "Notification Body",
        sound: "default",
    },
    'data':{// these is the data it calls in the messagereceived method
       'SenderID':senderauthid,
       'ReceiverId':receiverauthid,
       'SenderPhoneNumber':String(senderphonenumber),
       'SenderName':Sendertotalname,
       'flag':"3",
    }

 };//payload

 return admin.messaging().sendToDevice(RegisterationTokens, payload).then((response)=> { 

    console.info("Successfully sent notification")
    return res.status(200).json({Token : "Successfully sent notification"});

 }).catch(function(error) {
    console.warn("Error sending notification " , error)
 });//end of notification

在成功发送通知消息后,我收到一条错误消息,指出该消息

errorInfo: 
   { code: 'messaging/invalid-apns-credentials',
     message: 'A message targeted to an iOS device could not be sent because the required APNs SSL certificate was not uploaded or has expired. Check the validity of your development and production certificates.' },
  codePrefix: 'messaging' }

我已经在Firebase控制台的“ APNs身份验证密钥”部分中添加了“ APNs身份验证密钥”。我需要进行任何更改吗?

0 个答案:

没有答案