push-notify-apn-0.1.0.3: Send push notifications to mobile iOS devices

Copyright(C) 2017 memrange UG
LicenseBSD3
MaintainerHans-Christian Esperer <hc@memrange.io>
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Network.PushNotify.APN

Description

Send push notifications using Apple's HTTP2 APN API

Synopsis

Documentation

data ApnSession Source #

A session that manages connections to Apple's push notification service

data JsonAps Source #

A push notification message

Instances

Show JsonAps Source # 
Generic JsonAps Source # 

Associated Types

type Rep JsonAps :: * -> * #

Methods

from :: JsonAps -> Rep JsonAps x #

to :: Rep JsonAps x -> JsonAps #

ToJSON JsonAps Source # 
type Rep JsonAps Source # 
type Rep JsonAps = D1 (MetaData "JsonAps" "Network.PushNotify.APN" "push-notify-apn-0.1.0.3-ESFa8l3DKBU6yqVI6BW5hi" False) (C1 (MetaCons "JsonAps" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "jaAps") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 JsonApsMessage)) (S1 (MetaSel (Just Symbol "jaAppSpecificContent") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text)))))

data JsonApsAlert Source #

The specification of a push notification's message body

data ApnToken Source #

An APN token used to uniquely identify a device

sendMessage Source #

Arguments

:: ApnSession

Session to use

-> ApnToken

Device to send the message to

-> JsonAps

The message to send

-> IO ApnMessageResult 

Send a push notification message.

sendSilentMessage Source #

Arguments

:: ApnSession

Session to use

-> ApnToken

Device to send the message to

-> IO ApnMessageResult 

Send a silent push notification

newSession Source #

Arguments

:: FilePath

Path to the client certificate key

-> FilePath

Path to the client certificate

-> FilePath

Path to the CA

-> Bool

True if the apn evelopment servers should be used, False to use the production servers

-> Int

How many messages will be sent in parallel? This corresponds to the number of http2 streams open in parallel; 100 seems to be a default value.

-> ByteString

Topic (bundle name of the app)

-> IO ApnSession 

Start a new session for sending APN messages. A session consists of a connection pool of connections to the APN servers, while each connection has a pool of workers that create HTTP2 streams to send individual push notifications.

sendRawMessage Source #

Arguments

:: ApnSession

Session to use

-> ApnToken

Device to send the message to

-> ByteString

The message to send

-> IO ApnMessageResult 

Send a raw payload as a push notification message (advanced)

emptyMessage :: JsonApsMessage Source #

Create an empty apn message

setSound Source #

Arguments

:: Text

The sound to use (either "default" or something in the application's bundle)

-> JsonApsMessage

The message to modify

-> JsonApsMessage 

Set a sound for an APN message

clearSound Source #

Arguments

:: JsonApsMessage

The message to modify

-> JsonApsMessage 

Clear the sound for an APN message

setCategory Source #

Arguments

:: Text 
-> JsonApsMessage

The message to modify

-> JsonApsMessage 

Set the category part of an APN message

clearCategory Source #

Arguments

:: JsonApsMessage

The message to modify

-> JsonApsMessage 

Clear the category part of an APN message

setBadge Source #

Arguments

:: Int

The number to set. Use 0 to remove the number.

-> JsonApsMessage

The message to modify

-> JsonApsMessage 

Set the badge part of an APN message

clearBadge Source #

Arguments

:: JsonApsMessage

The message to modify

-> JsonApsMessage 

Clear the badge part of an APN message

alertMessage Source #

Arguments

:: Text

The title of the message

-> Text

The body of the message

-> JsonApsMessage 

Create a new APN message with an alert part

setAlertMessage Source #

Arguments

:: Text

The title of the message

-> Text

The body of the message

-> JsonApsMessage

The message to alter

-> JsonApsMessage 

Set the alert part of an APN message

clearAlertMessage Source #

Arguments

:: JsonApsMessage

The message to modify

-> JsonApsMessage 

Remove the alert part of an APN message

newMessage Source #

Arguments

:: JsonApsMessage

The standard message to include

-> JsonAps 

Prepare a new apn message consisting of a standard message without a custom payload

newMessageWithCustomPayload Source #

Arguments

:: JsonApsMessage

The message

-> Text

The custom payload

-> JsonAps 

Prepare a new apn message consisting of a standard message and a custom payload

hexEncodedToken Source #

Arguments

:: Text

The base16 (hex) encoded unique identifier for a device (APN token)

-> ApnToken 

Create a token from a hex encoded text

rawToken Source #

Arguments

:: ByteString

The bytestring that uniquely identifies a device (APN token)

-> ApnToken 

Create a token from a raw bytestring