Skip to content

how to set apns-expiration as 0 (zero)? #169

@deltapath-eric

Description

@deltapath-eric

https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/sending_notification_requests_to_apns/

The date at which the notification is no longer valid. This value is a UNIX epoch expressed in seconds (UTC). If the value is nonzero, APNs stores the notification and tries to deliver it at least once, repeating the attempt as needed until the specified date. If the value is 0, APNs attempts to deliver the notification only once and doesn’t store it.

if i understand correctly, the value can be 0 which make the notification will not resend

at client.go

if !n.Expiration.IsZero() {
  r.Header.Set("apns-expiration", fmt.Sprintf("%v", n.Expiration.Unix()))
}

seem if the value isZero(), the header will not be set and there is not way to set the header as 0

please correct me if i am wrong, thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions