-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Library for Apple Push Notification Service
--
-- This library provides an interface to send notifications with the
-- Apple Push Notification Service.
--
-- Note: Your connection to Apple's Push Notification service must be
-- secured with SSL. Currently, Haskell's support for SSL is incomplete,
-- therefore you should use an SSL tunnel to connect your application to
-- the push service, such as stunnel.
@package ApplePush
@version 0.1
-- | Types for the Apple Push Service
module ApplePush.Types
-- | Device Token
type DeviceToken = ByteString
-- | These messages are sent to the Apple Push Notification Service
data NotificationServiceMsg
NotificationServiceSend :: DeviceToken -> String -> NotificationServiceMsg
NotificationServiceExit :: NotificationServiceMsg
type NotificationServiceChan = Chan NotificationServiceMsg
-- | Callback messages from the Apple Push Notification Service
data NotificationCallbackMsg
NotificationServerConnected :: NotificationServiceChan -> NotificationCallbackMsg
NotificationServerUnableToConnect :: String -> NotificationCallbackMsg
NotificationServerDisconnected :: NotificationCallbackMsg
type NotificationCallbackChan = Chan NotificationCallbackMsg
-- | Notification payload is a JSON Object
type NotificationPayload = JSObject JSValue
-- | Notification actions
type NotificationAction = JSObject JSValue
-- | Helpers for the Apple Push Service
module ApplePush.Helpers
-- | Converts a hex string to a device token
hexTokenToByteString :: String -> DeviceToken
-- | Converts a device token to a hex string
tokenToString :: DeviceToken -> String
byteStringToHex :: ByteString -> String
-- | Creates JSON notification payloads for the Apple Push Notification
-- Service
module ApplePush.Notification
-- | Takes a list of key, JSValue pairs and converts them to a string
makeRawNotification :: [(String, JSValue)] -> String
-- | Makes a notification, takes an alert(stringdictionary), integer,
-- string for the sound, and any user data (keyvalue dictionary.)
makeNotification :: Maybe (Either String [(String, JSValue)]) -> Maybe Integer -> Maybe String -> Maybe [(String, JSValue)] -> String
-- | This module implements the Apple Push Notification Service
-- http://developer.apple.com/iPhone/library/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Introduction/Introduction.html#//apple_ref/doc/uid/TP40008194-CH1-SW1
--
-- The notification service uses Chan for asynchronous
-- communication. Call connectToNotificationService and pass it a
-- NotificationCallbackChan. The notification service will post a
-- NotificationServerConencted message, with a channel that you
-- should use to send notifications with.
module ApplePush
-- | Connects to the notification service for the host and port specified.
connectToNotificationService :: String -> Integer -> NotificationCallbackChan -> IO ()