Versions in this module Expand all Collapse all v1 v1.0.1 Mar 16, 2021 Changes in this version + const FeedbackTimeoutSeconds + const IdentifierUbound + const MaxPayloadSizeBytes + const TimeoutSeconds + var APPLE_PUSH_RESPONSES = ApplePushResponses + var ApplePushResponses = map[uint8]string + var FEEDBACK_TIMEOUT_SECONDS = FeedbackTimeoutSeconds + var FeedbackChannel = make(chan (*FeedbackResponse)) + var IDENTIFIER_UBOUND = IdentifierUbound + var MAX_PAYLOAD_SIZE_BYTES = MaxPayloadSizeBytes + var ShutdownChannel = make(chan bool) + var TIMEOUT_SECONDS = TimeoutSeconds + func StartMockFeedbackServer(certFile, keyFile string) + type APNSClient interface + ConnectAndWrite func(resp *PushNotificationResponse, payload []byte) (err error) + Send func(pn *PushNotification) (resp *PushNotificationResponse) + type AlertDictionary struct + ActionLocKey string + Body string + LaunchImage string + LocArgs []string + LocKey string + Title string + TitleLocArgs []string + TitleLocKey string + func NewAlertDictionary() *AlertDictionary + type Client struct + CertificateBase64 string + CertificateFile string + Gateway string + KeyBase64 string + KeyFile string + func BareClient(gateway, certificateBase64, keyBase64 string) (c *Client) + func NewClient(gateway, certificateFile, keyFile string) (c *Client) + func (client *Client) ConnectAndWrite(resp *PushNotificationResponse, payload []byte) (err error) + func (client *Client) ListenForFeedback() (err error) + func (client *Client) Send(pn *PushNotification) (resp *PushNotificationResponse) + func (client *Client) WithContext(ctx context.Context) + type FeedbackResponse struct + DeviceToken string + Timestamp uint32 + func NewFeedbackResponse() (resp *FeedbackResponse) + type MockClient struct + func (m *MockClient) ConnectAndWrite(resp *PushNotificationResponse, payload []byte) (err error) + func (m *MockClient) Send(pn *PushNotification) (resp *PushNotificationResponse) + type Payload struct + Alert interface{} + Badge int + Category string + ContentAvailable int + Sound string + func NewPayload() *Payload + type PushNotification struct + DeviceToken string + Expiry uint32 + Identifier int32 + Priority uint8 + func NewPushNotification() (pn *PushNotification) + func (pn *PushNotification) AddPayload(p *Payload) + func (pn *PushNotification) Get(key string) interface{} + func (pn *PushNotification) PayloadJSON() ([]byte, error) + func (pn *PushNotification) PayloadString() (string, error) + func (pn *PushNotification) Set(key string, value interface{}) + func (pn *PushNotification) ToBytes() ([]byte, error) + type PushNotificationResponse struct + AppleResponse string + Error error + Success bool + func NewPushNotificationResponse() (resp *PushNotificationResponse)