ToothlessGear / node-gcm

A NodeJS wrapper library port to send data to Android devices via Google Cloud Messaging
https://github.com/ToothlessGear/node-gcm
Other
1.3k stars 208 forks source link

readme error in failedTokens snippets #358

Closed yuripaoloni closed 2 years ago

yuripaoloni commented 2 years ago

This part of the readme is wrong and should be fixed.

sender.send(message, { registrationTokens: registrationTokens }, function (err, response) {
  var failed_tokens = registrationTokens.filter((token, i) => response[i].error != null);
  console.log('These tokens are no longer ok:', failed_tokens);
});

response[i] is not accessible, it should be response.results[i].

Anyway, thanks a lot for the amazing work with node-gcm.

eladnava commented 2 years ago

Hi @yuripaoloni, Nice find, thanks for catching that, and for your kind words. Fixed in a4df9a3. 👍