我是推送通知的新手,我已经完成了我从googling中引用的代码部分,它运行良好,但我的查询是:
这是我的密码:
var GCM = require('gcm').GCM;
var apiKey = 'xyz';
var gcm = new GCM('apiKey');
var message = {
registration_id: ['x','y'],
collapse_key: 'Hello',
priority: 'high',
contentAvailable: true,
delayWhileIdle: true,
timeToLive: 3,
};
gcm.send(message, function(err, messageId){
if (err) {
console.log("Something has gone wrong!");
console.log(err);
} else {
console.log("Sent with message ID: ", messageId);
}
});还有请告诉我有无限制(gcmid的号码)?一推?
发布于 2016-04-13 17:29:30
它将向所有注册in发送推送通知,即使在数组之间没有几个in看起来是无效的。注册id无效时的响应示例
{
multicast_id: 8976424350191695000,
success: 1,
failure: 1,
canonical_ids: 1,
results: [
{
registration_id: "value-of-correct-registration-id",
message_id: "0:1460568231005603%ade1213ff9fd7ecd"
},
{
error: "InvalidRegistration"
}
]
}成功和失败计数将显示发送和失败的推送通知的数量。并且没有对注册ids的数量施加限制。
https://stackoverflow.com/questions/36594197
复制相似问题