add ContentAvailable.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
parent
c940f64650
commit
c856edaa18
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue