parse-community / parse-server-push-adapter

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

Support headers in data field #148

Closed dplewis closed 4 years ago

dplewis commented 4 years ago

https://docs.parseplatform.org/js/guide/#customizing-your-notifications

The docs says that the headers should be in the data field

dplewis commented 4 years ago

@acinader Should we support this or fast fail and update the docs?

acinader commented 4 years ago

i'm not sure what you're referring to in the docs. is there an issue associated with this. just not enough info for me to understand the issue.

acinader commented 4 years ago

Ok, now I see that this is for https://github.com/parse-community/parse-server/issues/6106

If I've got it right, I think we should fast fail and update the docs.

codecov[bot] commented 4 years ago

Codecov Report

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

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #148   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           5      5           
  Lines         267    267           
=====================================
  Hits          267    267
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 08a9140...7edd649. Read the comment docs.

dplewis commented 4 years ago

@acinader @davimacedo I went ahead and allowed for both.

Parse.Push.send({
  channels: [ "Mets" ],
  push_type: ... // if used with have precedence over data field
  data: {
    alert: "The Mets scored! The game is now tied 1-1.",
    badge: "Increment",
    sound: "cheering.caf",
    title: "Mets Score!",
    push_type: ... // most users are familiar with the data field. changing it would cause confusion and   might be a breaking change for existing headers like priority
  }
})