Skip to content

Commit

Permalink
Badgecount change:
Browse files Browse the repository at this point in the history
Allow events to include a badge count which overrides the internal
badge counting
  • Loading branch information
afterthought committed Jun 3, 2015
1 parent a34cd3d commit 1f0164f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/payload.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class Payload
when 'msg' then @msg.default = value
when 'sound' then @sound = value
when 'incrementBadge' then @incrementBadge = value != 'false'
when 'badge' then @badge = value
when 'category' then @category = value
when 'contentAvailable' then @contentAvailable = value != 'false'
else
Expand Down
2 changes: 1 addition & 1 deletion lib/pushservices/apns.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class PushServiceAPNS
if subOptions?.ignore_message isnt true and alert = payload.localizedMessage(info.lang)
note.alert = alert

badge = parseInt(info.badge)
badge = parseInt(payload.badge || info.badge)
if payload.incrementBadge
badge += 1

Expand Down

0 comments on commit 1f0164f

Please sign in to comment.