Safe Haskell | None |
---|---|
Language | Haskell98 |
Small library that provides functions to send push messages to Android and Apple devices which have the Pushover app installed. Please note that the
IO functions make use of the network stack and should be wrapped with withSocketsDo
.
- data PushMessage = PM {}
- data PushResponse = PR {}
- data ReceiptResponse = RR {
- receiptstatus :: Int
- acknowledged :: Int
- acknowledgedAt :: Int
- lastDeliveredAt :: Int
- expired :: Int
- expiresAt :: Int
- calledBack :: Int
- calledBackAt :: Int
- type Apptoken = Text
- type Receipt = Text
- defaultMessage :: PushMessage
- sendPushMessage :: PushMessage -> IO PushResponse
- checkReceipt :: Apptoken -> Receipt -> IO ReceiptResponse
Data types
data PushMessage Source
The PushMessage data structure. To construct one of these, you should alter the message under *defaultMessage* using record syntax.
data PushResponse Source
When you send a PushMessage, the server replies with at least a status code and a request number. See the pushover API documentation for what each field means.
data ReceiptResponse Source
The reponse you get when you inquire about a receipt for a priority 2 message. See the pushover API documentation for what each field means.
RR | |
|
Default constructor
defaultMessage :: PushMessage Source
A default PushMessage (all empty fields except token
, user
and message
will be removed later in the POST request,
but the fields have to be there to overwrite them later (if you want)).
IO functions
sendPushMessage :: PushMessage -> IO PushResponse Source
Sends a push message to the Pushover servers.
checkReceipt :: Apptoken -> Receipt -> IO ReceiptResponse Source
Inquire about a receipt.