callback invoked multiple times after send() #10

Closed
tifroz opened this Issue Aug 13, 2011 · 1 comment

Comments

Projects
None yet
2 participants

tifroz commented Aug 13, 2011

I am instantiating my C2DM object once, then calling c2dm.send(msg, cb) every time I need to send a message to a device.

By doing so, the callback cb gets called multiple times for each send()....more specifically, cb gets called n times after the n-th time send() is called.

My wild guess: withing the send() method,
if (cb) this.on('sent', cb);
...should really be
if (cb) this.once('sent', cb);

Owner

SpeCT commented Aug 14, 2011

Thank you for the suggestion, I'm going to fix it in next release.

SpeCT closed this Mar 18, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment