Allow APNS expiration to be 0 (#436)
This commit is contained in:
@@ -81,7 +81,7 @@ type PushNotification struct {
|
|||||||
Notification fcm.Notification `json:"notification,omitempty"`
|
Notification fcm.Notification `json:"notification,omitempty"`
|
||||||
|
|
||||||
// iOS
|
// iOS
|
||||||
Expiration int64 `json:"expiration,omitempty"`
|
Expiration *int64 `json:"expiration,omitempty"`
|
||||||
ApnsID string `json:"apns_id,omitempty"`
|
ApnsID string `json:"apns_id,omitempty"`
|
||||||
CollapseID string `json:"collapse_id,omitempty"`
|
CollapseID string `json:"collapse_id,omitempty"`
|
||||||
Topic string `json:"topic,omitempty"`
|
Topic string `json:"topic,omitempty"`
|
||||||
|
|||||||
@@ -175,8 +175,8 @@ func GetIOSNotification(req PushNotification) *apns2.Notification {
|
|||||||
CollapseID: req.CollapseID,
|
CollapseID: req.CollapseID,
|
||||||
}
|
}
|
||||||
|
|
||||||
if req.Expiration > 0 {
|
if req.Expiration != nil {
|
||||||
notification.Expiration = time.Unix(req.Expiration, 0)
|
notification.Expiration = time.Unix(*req.Expiration, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(req.Priority) > 0 && req.Priority == "normal" {
|
if len(req.Priority) > 0 && req.Priority == "normal" {
|
||||||
|
|||||||
Reference in New Issue
Block a user