Allow ability to explicitly set APNS priority (#437)

Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Emmet McPoland
2020-02-07 03:50:20 +00:00
committed by GitHub
parent cee47bdc2c
commit dbc57cd828

View File

@@ -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 {