谷歌云消息推送通知 [英] google Cloud Messaging Push notification
问题描述
我可以使用谷歌浏览器邮差客户端发送有效载荷消息到GCM服务器进行测试的目的。 其次,如果有的话,是要发送的标题和URL参数。
Can I use POSTMAN client on Google Chrome to send payload message to GCM server for testing purpose. Secondly if yes, what is the header and url parameter to be sent.
推荐答案
是的,你可以。
网址: https://android.googleapis.com/gcm/send
标题:
- 授权:键=<您-API密钥>
- 内容类型:应用程序/ JSON
正文(单击原始选项卡上):
Body (click on the 'raw' tab):
{
"collapse_key": "score_update",
"time_to_live": 108,
"delay_while_idle": true,
"data": {
"score": "4x8",
"time": "15:16.2342"
},
"registration_ids":["4", "8", "15", "16", "23", "42"]
}
注: registration_ids
是唯一的必填字段,所有其他的都是可选的。
Note: registration_ids
is the only required field, all the others are optional.
网址: https://android.googleapis.com/gcm/send
标题:
- 授权:键=<您-API密钥>
- 内容类型:应用程序/ x-WWW的形式urlen codeD;字符集= UTF-8
正文(点击X WWW的形式,urlen codeD选项卡):
Body (click on the 'x-www-form-urlencoded' tab):
collapse_key=score_update
time_to_live=108
delay_while_idle=1
data.score=4x8
data.time=15:16.2342
registration_id=42
注: registration_id
是唯一的必填字段,所有其他的都是可选的。
Note: registration_id
is the only required field, all the others are optional.
来源:<一href="https://developer.android.com/google/gcm/http.html">https://developer.android.com/google/gcm/http.html
这篇关于谷歌云消息推送通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!