diff --git a/server/server.go b/server/server.go index b971aba0..35ff8567 100644 --- a/server/server.go +++ b/server/server.go @@ -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)