Ho assistente node.js:Google Cloud Messaging (fake_message_id)
var gcm = require('node-gcm');
// create a message with default values
var message = new gcm.Message();
// or with object values
var message = new gcm.Message({
collapseKey: 'demo',
delayWhileIdle: true,
timeToLive: 3,
data: {
key1: 'message1',
key2: 'message2'
}
});
var sender = new gcm.Sender('AIzaSyChp2jTQsgPkLaaVgFh6yoovu1Td7tuQMo');
var registrationIds = [];
// OPTIONAL
// add new key-value in data object
message.addDataWithKeyValue('key1','message1');
message.addDataWithKeyValue('key2','message2');
// or add a data object
message.addDataWithObject({
key1: 'message1',
key2: 'message2'
});
// or with backwards compability of previous versions
message.addData('key1','message1');
message.addData('key2','message2');
message.collapseKey = 'demo';
message.delayWhileIdle = true;
message.timeToLive = 3;
message.dryRun = true;
// END OPTIONAL
// At least one required
registrationIds.push('APA91bGV0W6lgapC07aHc-sQdd462f_lCoUY0r5mqVtdFX1ZfK31njMUeyVXXXXXXXXXXXXXXXXXXXXXXXXX0SiAp29dkyxdJ5Y8Cl2tO1aih0KeViA9hK3Q47atoU8qsD6ITbg');
/**
* Params: message-literal, registrationIds-array, No. of retries, callback-function
**/
sender.send(message, registrationIds, 4, function (err, result) {
console.log(result);
});
Ho un:
{multicast_id: -1, successo: 1, il fallimento: 0, canonical_ids: 0, i risultati:
[{message_id: fake_message_id'}]}
e il messaggio non invia ai ricevitori.
Che cosa significa fake_message_id?
Grazie per questa risposta –