简体   繁体   English

将推送发送到多个设备FCM(Web)无法生成通知密钥

[英]Send push to multiple devices FCM (Web) unable to generate notification key

I am trying to figure how to group multiple tokens ids and do a "Group messaging" not through topic group. 我试图弄清楚如何对多个令牌ID进行分组,而不是通过主题组进行“分组消息传递”。 The document says the response will send a unique notification key: 该文档说响应将发送一个唯一的通知密钥:

  1. Using FCM 使用FCM
  2. Group multiple devices 分组多个设备
  3. Web push through JavaScript 通过JavaScript进行网络推送

Here is the Postman request I am sending: 这是我发送的邮递员请求:

在此处输入图片说明

See the response: 查看响应:

在此处输入图片说明

But I am not getting the unique notification KEY as per the document from google FCM . 但是我没有从谷歌FCM的文档中获得唯一的通知键。

在此处输入图片说明

You're using the endpoint for sending a message: 您正在使用端点发送消息:

https://fcm.googleapis.com/fcm/send

Resulting for it to return a response as if you sent a message. 结果使其返回响应,就像您发送了一条消息一样。 It ignores the other parameters ( operation , notification_key_name ) and uses only registration_ids . 它忽略其他参数( operationnotification_key_name ),仅使用registration_ids

As seen in the sample POST request in the docs (the docs is under Android, but the sample is a POST request so it shouldn't matter), you should use: 如在文档中的示例POST请求中所见(该文档位于Android下, 该示例是POST请求,因此无关紧要),您应该使用:

https://android.googleapis.com/gcm/notification

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM