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

Fixes #192 Support Authorization header as an option #193

Closed wingleung closed 8 years ago

wingleung commented 8 years ago

Original code uses GCM Api key as Authorization header, but this doesn't work. Just to be sure, I left the original code in as fallback as I don't know if this is legacy code or not.

Updated README as well to show an example of an authorization header value.

// Set custom request options
var requestOptions = {
    proxy: 'http://127.0.0.1:8888',
    timeout: 5000,
    Authorization: 'key=YOUR_AUTHORIZATION_KEY_HERE'
};
wingleung commented 8 years ago

I have a different version of the package, will look into it later