Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ func (c *Client) PushWithContext(ctx Context, n *Notification) (*Response, error
r := &Response{}
r.StatusCode = response.StatusCode
r.ApnsID = response.Header.Get("apns-id")
r.ApnsUpdateToken = response.Header.Get("apns-update-token")

decoder := json.NewDecoder(response.Body)
if err := decoder.Decode(r); err != nil && err != io.EOF {
Expand Down
5 changes: 5 additions & 0 deletions response.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,11 @@ type Response struct {
// If the value of StatusCode is 410, this is the last time at which APNs
// confirmed that the device token was no longer valid for the topic.
Timestamp Time

// ApnsUpdateToken is returned by APNs when the notification payload contains
// "input-push-token": 1. It can be used to send subsequent Live Activity
// update pushes without waiting for the app to register the token.
ApnsUpdateToken string
}

// Sent returns whether or not the notification was successfully sent.
Expand Down