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