MCPcopy
hub / github.com/sideshow/apns2 / Push

Method Push

client.go:155–157  ·  view source on GitHub ↗

Push sends a Notification to the APNs gateway. If the underlying http.Client is not currently connected, this method will attempt to reconnect transparently before sending the notification. It will return a Response indicating whether the notification was accepted or rejected by the APNs gateway, or

(n *Notification)

Source from the content-addressed store, hash-verified

153//
154// Use PushWithContext if you need better cancellation and timeout control.
155func (c *Client) Push(n *Notification) (*Response, error) {
156 return c.PushWithContext(context.Background(), n)
157}
158
159// PushWithContext sends a Notification to the APNs gateway. Context carries a
160// deadline and a cancellation signal and allows you to close long running

Callers 15

mainFunction · 0.95
mainFunction · 0.95
TestClientBadUrlErrorFunction · 0.80
TestClientBadDeviceTokenFunction · 0.80
TestURLFunction · 0.80
TestDefaultHeadersFunction · 0.80
TestHeadersFunction · 0.80
TestExpirationHeaderFunction · 0.80
TestPushTypeAlertHeaderFunction · 0.80

Calls 1

PushWithContextMethod · 0.95

Tested by 15

TestClientBadUrlErrorFunction · 0.64
TestClientBadDeviceTokenFunction · 0.64
TestURLFunction · 0.64
TestDefaultHeadersFunction · 0.64
TestHeadersFunction · 0.64
TestExpirationHeaderFunction · 0.64
TestPushTypeAlertHeaderFunction · 0.64
TestPushTypeVOIPHeaderFunction · 0.64