Safe Haskell | None |
---|
Network.PushNotify.Apns
Description
This library defines an API for communicating with iOS powered devices, sending Push Notifications through Apple Push Notification Service.
- sendAPNS :: APNSManager -> APNSmessage -> IO APNSresult
- startAPNS :: APNSConfig -> IO APNSManager
- closeAPNS :: APNSManager -> IO ()
- withAPNS :: APNSConfig -> (APNSManager -> IO a) -> IO a
- feedBackAPNS :: APNSConfig -> IO APNSFeedBackresult
- data APNSConfig = APNSConfig {}
- data APNSManager
- type DeviceToken = Text
- data Env
- = Development
- | Production
- | Local
- data APNSmessage = APNSmessage {}
- data AlertDictionary = AlertDictionary {
- body :: Text
- action_loc_key :: Text
- loc_key :: Text
- loc_args :: [Text]
- launch_image :: Text
- data APNSresult = APNSresult {}
- data APNSFeedBackresult = APNSFeedBackresult {}
APNS Service
sendAPNS :: APNSManager -> APNSmessage -> IO APNSresultSource
sendAPNS
sends the message to a APNS Server.
startAPNS :: APNSConfig -> IO APNSManagerSource
startAPNS
starts the APNS service.
closeAPNS :: APNSManager -> IO ()Source
closeAPNS
stops the APNS service.
withAPNS :: APNSConfig -> (APNSManager -> IO a) -> IO aSource
withAPNS
creates a new manager, uses it in the provided function, and then releases it.
feedBackAPNS :: APNSConfig -> IO APNSFeedBackresultSource
feedBackAPNS
connects to the Feedback service.
APNS Settings
data APNSConfig Source
APNSConfig
represents the main necessary information for sending notifications through APNS.
For loading the certificate and privateKey you can use: fileReadCertificate
and fileReadPrivateKey
.
Constructors
APNSConfig | |
Fields
|
Instances
data APNSManager Source
type DeviceToken = TextSource
Binary token stored in hexadecimal representation as text.
Env
represents the three possible working environments. This determines the url and port to connect to.
Constructors
Development | Development environment (by Apple). |
Production | Production environment (by Apple). |
Local | Local environment, just to test the service in the "localhost". |
APNS Messages
data APNSmessage Source
APNSmessage
represents a message to be sent through APNS.
Constructors
APNSmessage | |
Fields
|
Instances
data AlertDictionary Source
AlertDictionary
represents the possible dictionary in the alert
label.
Constructors
AlertDictionary | |
Fields
|
APNS Results
data APNSresult Source
APNSresult
represents information about messages after a communication with APNS Servers.
Constructors
APNSresult | |
Fields
|
Instances
data APNSFeedBackresult Source
APNSFeedBackresult
represents information after connecting with the Feedback service.
Constructors
APNSFeedBackresult | |
Fields
|
Instances