pinpon-0.2.0.2: A gateway for various cloud notification services

Safe HaskellNone
LanguageHaskell2010

Network.PinPon.WireTypes.APNS

Contents

Synopsis

Apple Push Notification service on-the-wire types.

These Haskell types are injections to their synonyms in the APNS JSON spec. See <https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CreatingtheNotificationPayload.html#//apple_ref/doc/uid/TP40008194-CH10-SW1 here> and <https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/PayloadKeyReference.html#//apple_ref/doc/uid/TP40008194-CH17-SW1 here> for details.

These types are only sent to APNS (via SNS) and are never received on the wire, so they are not instances of FromJSON, only ToJSON.

Not all valid APNS fields are represented in these Haskell types; only the fields used by pinpon are implemented.

data Alert Source #

A partial representation of the APNS alert dictionary. See <https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/PayloadKeyReference.html#//apple_ref/doc/uid/TP40008194-CH17-SW4 here> for details.

Note that while the APNS wire protocol permits an alert to be represented as a single JSON string, rather than a dictionary, we only support the dictionary representation.

Constructors

Alert 

Fields

Instances

Show Alert Source # 

Methods

showsPrec :: Int -> Alert -> ShowS #

show :: Alert -> String #

showList :: [Alert] -> ShowS #

Generic Alert Source # 

Associated Types

type Rep Alert :: * -> * #

Methods

from :: Alert -> Rep Alert x #

to :: Rep Alert x -> Alert #

ToJSON Alert Source # 
type Rep Alert Source # 
type Rep Alert = D1 * (MetaData "Alert" "Network.PinPon.WireTypes.APNS" "pinpon-0.2.0.2-AXC4hAYjBLsFCvhzvk0k5U" False) (C1 * (MetaCons "Alert" PrefixI True) ((:*:) * (S1 * (MetaSel (Just Symbol "_title") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * Text)) (S1 * (MetaSel (Just Symbol "_body") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * Text))))

defaultAlert :: Alert Source #

A pinpon-specific default value for Alert.

data Aps Source #

Constructors

Aps 

Fields

Instances

Show Aps Source # 

Methods

showsPrec :: Int -> Aps -> ShowS #

show :: Aps -> String #

showList :: [Aps] -> ShowS #

Generic Aps Source # 

Associated Types

type Rep Aps :: * -> * #

Methods

from :: Aps -> Rep Aps x #

to :: Rep Aps x -> Aps #

ToJSON Aps Source # 
type Rep Aps Source # 
type Rep Aps = D1 * (MetaData "Aps" "Network.PinPon.WireTypes.APNS" "pinpon-0.2.0.2-AXC4hAYjBLsFCvhzvk0k5U" False) (C1 * (MetaCons "Aps" PrefixI True) ((:*:) * (S1 * (MetaSel (Just Symbol "_alert") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Alert)) (S1 * (MetaSel (Just Symbol "_sound") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * Text))))

defaultAps :: Aps Source #

A pinpon-specific default value for Aps.

newtype Payload Source #

The top-level APNS dictionary object. See <https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CreatingtheNotificationPayload.html#//apple_ref/doc/uid/TP40008194-CH10-SW15 here> for details.

Note that objects other than the aps dictionary may be included in APNS payloads, but as pinpon doesn't use them, that functionality is not implemented.

Constructors

Payload 

Fields

Instances

Show Payload Source # 
Generic Payload Source # 

Associated Types

type Rep Payload :: * -> * #

Methods

from :: Payload -> Rep Payload x #

to :: Rep Payload x -> Payload #

ToJSON Payload Source # 
type Rep Payload Source # 
type Rep Payload = D1 * (MetaData "Payload" "Network.PinPon.WireTypes.APNS" "pinpon-0.2.0.2-AXC4hAYjBLsFCvhzvk0k5U" True) (C1 * (MetaCons "Payload" PrefixI True) (S1 * (MetaSel (Just Symbol "_aps") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Aps)))

defaultPayload :: Payload Source #

A pinpon-specific default value for an APNS Payload.