您好我正在尝试使用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