-
Notifications
You must be signed in to change notification settings - Fork 18
Allow sending with no payload, plus some small fixes #17
Conversation
* @return {Promise} A promise that resolves if the push was sent successfully | ||
* with status and body. | ||
*/ | ||
function sendWebPush(message, subscription, authToken) { | ||
function sendWebPush(message, subscription, authToken, paddingLength) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you switch around the paddingLength with the authToken? When GCM goes away, the only change will be remove the authtoken.
I'm still pro just making a special method of GCM Auth header, simplifying sendWebPush method.
This change will also likely result in developers always sending the GCM API Key to all push services :(
cc @petele Awesome - thanks for doing this. Only concern is still with the auth token, I can see people doing:
Which means they are sharing their API key with the world :( If we changed back to a method, we can be smarter and only include the header for GCM requests.
|
I would be strongly in favour of this if we can push for it. I had similar concerns to @gauntface about API keys being shared with the world and can see folks tripping up here :/ |
@gauntface OK, done |
'Encryption': `salt=${ub64(payload.salt)}`, | ||
'Crypto-Key': `dh=${ub64(payload.serverPublicKey)}` | ||
// TODO: Make TTL variable | ||
Ttl: '0' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mega nit, shouldn't this be TTL similar to: https://github.com/gauntface/simple-push-demo/pull/28/files
One small nit on TTL, other than that - LGTM |
@gauntface you're right, spec says |
@gauntface
Fixes #10