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

Corrected JSON data format when sending message #2

Closed monkbroc closed 12 years ago

monkbroc commented 12 years ago

Hello, Thanks for the Node.js module!

I found an issue when passing data to a GCM message. The JSON needs to have data as a main key, then the payload needs to be sub-keys.

Please review my changes or implement something similar in your main repository.

{ "registration_id" : "APA91bHun4MxP5egoKMwt2KZFBaFUH-1RYqx...", "data" : { "foo" : "bar" }, }

ToothlessGear commented 12 years ago

Yes you are right! I forgot to change that, as I didn't use the JSON Format before. Thank you!

monkbroc commented 12 years ago

No problem. I just started working on a C2DM app and server a week ago and then 2 days in, C2DM gets deprecated! I'm glad you came up with a GCM module so fast! It was suprisingly easy to upgrade on the device side though.

On Jul 3, 2012 6:38 PM, "Marcus F" < reply@reply.github.com> wrote:

Yes you are right! I forgot to change that, as I didn't use the JSON Format before. Thank you!


Reply to this email directly or view it on GitHub: https://github.com/ToothlessGear/node-gcm/pull/2#issuecomment-6748544