-
-
Notifications
You must be signed in to change notification settings - Fork 106
Add support for passing collapse-id to APNS #79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for passing collapse-id to APNS #79
Conversation
Codecov Report
@@ Coverage Diff @@
## master #79 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 5 5
Lines 249 252 +3
=====================================
+ Hits 249 252 +3
Continue to review full report at Codecov.
|
Thanks for the PR. Can you provide links to the docs from the APN lib as well as apple's so I can doublecheck if it's implemented as expected? |
src/APNS.js
Outdated
@@ -95,7 +96,8 @@ export class APNS { | |||
continue; | |||
} | |||
|
|||
let notification = APNS._generateNotification(coreData, expirationTime, appIdentifier); | |||
let headers = { expirationTime: expirationTime, appIdentifier: appIdentifier, collapseId: collapseId } |
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.
the appIdentifier header should be renamed topic
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.
Great. Good spot 👍
Thanks for the docs! Very helpful :) Just one small nit. |
Looking great! thanks! |
Added support for adding
apns-collapse-id
to enable collapsing of pushes just like theapns-expiration
.I changed the method signature for
APNS_generateNotification
fromAPNS._generateNotification(data, expirationDate)
toAPNS._generateNotification(data, headers)
making it easier to add more header properties in the future.headers
The headers parameter is a JS object with the following supported properties:
Don't hesitate to feedback on the code as JS isn't my "native" language :)