h2soft / node-gcm

MIT License
68 stars 20 forks source link

Switch to JSON based requests #6

Open andredigenova opened 9 years ago

andredigenova commented 9 years ago

Modified the package to use JSON instead of urlencoded form. It simplifies the interface a bunch (you can just pass in a native javascript hash instead of doing things like using 'data.key1' as a key)

I did this mostly because I wanted to use GCM's user notifications feature and was having a ton of trouble getting it to work via the urlencoded form. I managed to get it to work by sending

message = {to: 'notification_key', data: {foo: 'hello'}};

bradjcheme commented 8 years ago

I hope this pull request will solve the issues with sending notifications to iOS devices.