Skip to content

Commit

Permalink
Fixed iOS badge updating for clear notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
jwilander committed Aug 18, 2016
1 parent 3538c3a commit dd46bcd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,15 @@ func sendAndroidNotification(msg *PushNotification) {
func sendAppleNotification(msg *PushNotification) {
payload := apns.NewPayload()

if msg.Type == PUSH_TYPE_CLEAR {
payload.Badge = 0
} else {
if msg.Type != PUSH_TYPE_CLEAR {
payload.Alert = emoji.Sprint(msg.Message)
payload.Badge = msg.Badge
payload.Category = msg.Category
payload.Sound = "default"
}

payload.Badge = msg.Badge

pn := apns.NewPushNotification()
pn.DeviceToken = msg.DeviceId
pn.AddPayload(payload)
Expand Down

0 comments on commit dd46bcd

Please sign in to comment.