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

How to set priority of a GCM message? #147

Closed mkamioner closed 9 years ago

mkamioner commented 9 years ago

Hi!

According to GCM documentation, priority can be set using a string "normal" or "high". How can I set this using this module? I found the priority argument in lib/message-options.js but it is a number, and has no __argName

If this feature is not currently available/supported in this module, I would be happy to make a pull request, but I wanted to check to make sure I am not just reading the code incorrectly.

Thanks! Mo

hypesystem commented 9 years ago

This is new to the documentation! When the feature was added, no documentation for GCM's handling of priority existed.

In short: its an error in the library. Please feel free to make a PR that changes the type to string. If no __argName is set in message-options.js, it defaults to the same as the key for the entry (in this case priority). All you need to do is fix the type :)

hypesystem commented 9 years ago

Oh, and the README should probably be updated to reflect correct behaviour (it currently shows an example with priority: 3, which is wrong.

mkamioner commented 9 years ago

I am on it :-)

mkamioner commented 9 years ago

https://github.com/ToothlessGear/node-gcm/pull/148