FCM发送推送到设备组返回'消息/无效接收者'

时间:2017-05-19 12:37:15

标签: node.js firebase firebase-cloud-messaging

您好我正在尝试使用Firebase Cloud Functions通过FCM向这样的设备组发送推送通知:

// Send a message to the device group corresponding to the provided
// notification key.
admin.messaging().sendToDeviceGroup(notification_key, payload)
.then(function(response) {
// See the MessagingDeviceGroupResponse reference documentation for
// the contents of response.
    console.log("Successfully sent message:", response);
})
.catch(function(error) {
   console.log("Error sending message:", error);
   });
}

控制台告诉我:

{ code: 'messaging/invalid-recipient',
 message: 'Notification key provided to sendToDeviceGroup() is invalid.' } }

我使用的notification_key是:const notification_key = "APA91bG09Lqs...rb48dE5hs"; 并且是我在创建设备组时在响应中返回的notification_key

0 个答案:

没有答案