PinchProject / Node-GCMService

Node-GCMService
15 stars 10 forks source link

Fixed array issue with batches <= 1000 registration_ids #7

Closed silentjohnny closed 3 years ago

silentjohnny commented 10 years ago

Mmmm, somehow my issue description wasn't saved, so here goes:

Since the latest release (0.8.2) single messages don't send anymore. This is because of the

if (registration_ids.length <= 1000) return callback(registration_ids);

statement in Sender.js

Instead of returning an array of arrays, as is expected by the _send method, this returns an array with one element. After that _send now sends a String to GCM and therefore the calls fail with a 400 BAD_REQUEST.

Pull request should fix the issue.

igorissen commented 10 years ago

Sorry but I no longer work in this start-up. I hope someone will replace me. If you want, you can use the module on which I was inspired : node-gcm.