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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

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 {