diff --git a/gorush/notification.go b/gorush/notification.go index 36182d2..3f77a99 100644 --- a/gorush/notification.go +++ b/gorush/notification.go @@ -81,7 +81,7 @@ type PushNotification struct { Notification fcm.Notification `json:"notification,omitempty"` // iOS - Expiration int64 `json:"expiration,omitempty"` + Expiration *int64 `json:"expiration,omitempty"` ApnsID string `json:"apns_id,omitempty"` CollapseID string `json:"collapse_id,omitempty"` Topic string `json:"topic,omitempty"` diff --git a/gorush/notification_apns.go b/gorush/notification_apns.go index 79ba53a..dc4b289 100644 --- a/gorush/notification_apns.go +++ b/gorush/notification_apns.go @@ -175,8 +175,8 @@ func GetIOSNotification(req PushNotification) *apns2.Notification { CollapseID: req.CollapseID, } - if req.Expiration > 0 { - notification.Expiration = time.Unix(req.Expiration, 0) + if req.Expiration != nil { + notification.Expiration = time.Unix(*req.Expiration, 0) } if len(req.Priority) > 0 && req.Priority == "normal" {