diff --git a/notification.go b/notification.go index 8d579ee..ce59843 100644 --- a/notification.go +++ b/notification.go @@ -19,10 +19,13 @@ type RequestPushNotification struct { Platform int `json:"platform" binding:"required"` Message string `json:"message" binding:"required"` Priority string `json:"priority,omitempty"` + ContentAvailable bool `json:"content_available,omitempty"` + // Android CollapseKey string `json:"collapse_key,omitempty"` DelayWhileIdle bool `json:"delay_while_idle,omitempty"` TimeToLive int `json:"time_to_live,omitempty"` + // iOS ApnsID string `json:"apns_id,omitempty"` Topic string `json:"topic,omitempty"` @@ -88,6 +91,10 @@ func pushNotificationIos(req RequestPushNotification, client *apns.Client) bool payload.Sound(req.Sound) } + if req.ContentAvailable { + payload.ContentAvailable() + } + if len(req.Extend) > 0 { for _, extend := range req.Extend { payload.Custom(extend.Key, extend.Value)