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 206 forks source link

Move the interface closer to the actual content of GCM notifications #144

Open hypesystem opened 9 years ago

hypesystem commented 9 years ago

Replace collapseKey with collapse_key, etc.

It would also be really cool if we could make it possible to send pre-built messages, for when the user knows what she is doing:

var gcm = require("gcm");
var sender = new gcm.Sender("<api key>");
sender.send({
    data: {
        hello: "world"
    }
}, "<registration id>", callback);
eladnava commented 8 years ago

@hypesystem Would we provide the old keys as aliases for backward compatibility?

hypesystem commented 8 years ago

This PR has been marked with the v1 milestone (https://github.com/ToothlessGear/node-gcm/milestones/v1), becasue it contains breaking changes.

I use it to collect ideas for breaking changes that would make for a nicer interface. I don't think backwards compatibility should be a concern when we move to 1.0.0 --- learning from the experiences of pre-1.0 should be the prime concern :smile:

eladnava commented 8 years ago

Cool. I definitely agree with making it possible to pass in properties the same way as with GCM (collapse_key for example)