parse-community / parse-server-push-adapter

A push notification adapter for Parse Server
https://parseplatform.org
MIT License
85 stars 100 forks source link

Add support for passing collapse-id to APNS #79

Closed Amnell closed 7 years ago

Amnell commented 7 years ago

Added support for adding apns-collapse-id to enable collapsing of pushes just like the apns-expiration.

I changed the method signature for APNS_generateNotification from APNS._generateNotification(data, expirationDate) to APNS._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 :)

codecov[bot] commented 7 years ago

Codecov Report

Merging #79 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #79   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           5      5           
  Lines         249    252    +3     
=====================================
+ Hits          249    252    +3
Impacted Files Coverage Δ
src/APNS.js 100% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 68c9742...4b6dc09. Read the comment docs.

flovilmart commented 7 years ago

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?

Amnell commented 7 years ago

@flovilmart

flovilmart commented 7 years ago

Thanks for the docs! Very helpful :) Just one small nit.

flovilmart commented 7 years ago

Looking great! thanks!