Skip to content

Commit

Permalink
Allow ability to explicitly set APNS priority (#437)
Browse files Browse the repository at this point in the history
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
  • Loading branch information
McPo and appleboy authored Feb 7, 2020
1 parent cee47bd commit dbc57cd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions gorush/notification_apns.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,12 @@ func GetIOSNotification(req PushNotification) *apns2.Notification {
notification.Expiration = time.Unix(*req.Expiration, 0)
}

if len(req.Priority) > 0 && req.Priority == "normal" {
notification.Priority = apns2.PriorityLow
if len(req.Priority) > 0 {
if req.Priority == "normal" {
notification.Priority = apns2.PriorityLow
} else if req.Priority == "high" {
notification.Priority = apns2.PriorityHigh
}
}

if len(req.PushType) > 0 {
Expand Down

0 comments on commit dbc57cd

Please sign in to comment.