apns-http2-0.1.1.0: Apple Push Notification service HTTP/2 integration.

Safe HaskellNone
LanguageHaskell2010

Network.Apns.Types

Description

Public types for using the APNs integration.

Synopsis

Documentation

data ApnsPushData Source #

Data for an APNs push message, consisting of its target device token, information that gets sent as headers with the push request such as expiration and topic, and the payload itself.

Constructors

ApnsPushData 

Fields

Instances
Show ApnsPushData Source # 
Instance details

Defined in Network.Apns.Types

data ApnsErrorReason Source #

Various error codes reported by APNs in response to a push or on the connection as a whole. See APNs documentation for meanings.

Instances
Bounded ApnsErrorReason Source # 
Instance details

Defined in Network.Apns.Types

Enum ApnsErrorReason Source # 
Instance details

Defined in Network.Apns.Types

Eq ApnsErrorReason Source # 
Instance details

Defined in Network.Apns.Types

Ord ApnsErrorReason Source # 
Instance details

Defined in Network.Apns.Types

Show ApnsErrorReason Source # 
Instance details

Defined in Network.Apns.Types

apnsErrorReasonToText :: ApnsErrorReason -> Text Source #

Convert an ApnsErrorReason to its text equivalent.

apnsErrorReasonFromText :: Text -> Maybe ApnsErrorReason Source #

Convert a text value to a Just ApnsErrorReason if the text value is a valid error reason, Nothing if it's invalid.

data ApnsError Source #

Structure carrying error information returned by APNs in response to a push.

Constructors

ApnsError 

Fields

Instances
Show ApnsError Source # 
Instance details

Defined in Network.Apns.Types

data ApnsPushResult Source #

The result of a push delivery attempt.

Constructors

ApnsPushDelivered ByteString

The push was successfully delivered to APNs along with its assigned apns-id. It may or may not be delivered to the target device, at the discretion of APNs.

ApnsPushErrored ApnsError

APNs rejected the push notification. See the ApnsError for more detail.

ApnsPushStreamError ErrorCodeId ByteString

APNs reset the HTTP2 stream before delivery could be completed. The push was most likely not accepted by APNs. The HTTP2 ErrorCodeId and error data are given.

ApnsPushResponseParseError Text

APNs gave an error response but it could not be parsed as JSON. The JSON parsing error is given.

ApnsPushDropped

APNs closed the HTTP/2 connection and indicated it did not process the push. It should be resubmitted on a new connection.

ApnsPushConnectionClosed

The connection to APNs was already closed by the time the push was requested. It should be resubmitted on a new connection.

ApnsPushStreamsExhausted

The HTTP/2 connection cannot allocate any more new streams. The connection should be closed and the push resubmitted on a new connection.

data ApnsPush Source #

Push notification data along with a callback that's invoked with the disposition of the push as soon as it's known.

Constructors

ApnsPush 

Fields

data ApnsTerminationReason Source #

The reason an APNs connection was terminated.

Constructors

ApnsTerminatedLocally

The APNs connection was locally closed using _apnsConnection_close.

ApnsTerminatedRemotely (Either ByteString ApnsErrorReason)

The APNs connection was remotely closed by APNs. The APNs error reason is given as Right if available, otherwise some other error string given as Left.

ApnsTerminatedHttp2Error HTTP2Error

The APNs connection was terminated due to an HTTP/2 protocol error.

ApnsTerminatedSilentlyClosed

The APNs connection was terminated because a foreign entity closed the TCP stream and no reason was provided.

ApnsTerminatedInsufficientHeaderBytes

The APNs connection was terminated because the TCP stream ended before being able to read all the header bytes for an HTTP/2 frame.

ApnsTerminatedInsufficientPayloadBytes FrameTypeId

The APNs connection was terminated because the TCP stream ended before being able to read all the payload bytes for an HTTP/2 frame.

ApnsTerminatedOversizedPayload

The APNs connection was terminated because the server send a frame with a purported payload size larger than the currently negotiated MAX_FRAME_SIZE.

ApnsTerminatedReadError SomeException

The APNs connection was terminated by an I/O error while reading.

ApnsTerminatedWriteError SomeException

The APNs connection was terminated by an I/O error while writing.

ApnsTerminatedProcessingException SomeException

The processing thread died due to some unexpected exception. Pushes currently in transit might or might not be delivered.

data ApnsConnectionParams Source #

Parameters for establishing an APNs connection.

Constructors

ApnsConnectionParams 

Fields

data ApnsConnectionError Source #

Indication of reason for an APNs connection attempt failing before the main asynchronous processing could begin.

Constructors

ApnsConnectionErrorInvalidHostName HostName

The host name given as _apnsConnectionParams_hostName was not resolvable.

ApnsConnectionErrorConnectFailed HostName [IOException]

The host name and port given as _apnsConnectionParams_hostName and _apnsConnectionParams_portNumber could not be connected to on any of the resolved addresses. The exceptions generated when connections were attempted are given.

ApnsConnectionErrorInvalidServerPreface

The server did not initiate with a valid HTTP/2 server preface, defined as a SETTINGS frame. Typically this indicates that the host was not APNs, APNs is catastrophically down, or something along those lines.

ApnsConnectionErrorException SomeException

An unexpected error occurred while waiting for the server to complete the HTTP/2 handshake.

data ApnsConnection Source #

An established APNs connection. In the future this should get metric and status reporting functions.

Constructors

ApnsConnection 

Fields