push-notify-0.1.0.0: A server-side library for sending push notifications.

Safe HaskellNone

Network.PushNotify.Gcm.Types

Contents

Description

This Module define the main data types for sending Push Notifications through Google Cloud Messaging.

Synopsis

GCM Settings

data GCMHttpConfig Source

GCMHttpConfig represents the main necessary information for sending notifications through GCM.

Constructors

GCMHttpConfig 

Fields

apiKey :: Text

Api key provided by Google.

numRet :: Int

Number of attemps to send the message to the server.

type RegId = TextSource

RegId is an unique identifier of an app/device, provided by GCM.

GCM Messages

data GCMmessage Source

GCMmessage represents a message to be sent through GCM. In general cases, you can use the Default value and only specify registration_ids and data_object.

On the other hand, if you want to use the rest of specific aspects, you can find more information on GCM website.

GCM Result

data GCMresult Source

GCMresult represents information about messages after a communication with GCM Servers.

Constructors

GCMresult 

Fields

multicast_id :: Maybe Integer

Unique ID (number) identifying the multicast message.

success :: Maybe Int

Number of messages that were processed without an error.

failure :: Maybe Int

Number of messages that could not be processed.

canonical_ids :: Maybe Int

Number of results that contain a canonical registration ID.

newRegids :: HashMap RegId RegId

RegIds that need to be replaced.

messagesIds :: HashMap RegId Text

Successful RegIds, and its "message_id".

errorUnRegistered :: HashSet RegId

Failed regIds that need to be removed.

errorToReSend :: HashSet RegId

Failed regIds that is necessary to resend the message to, because there was an internal problem in GCM servers.

errorRest :: HashMap RegId Text

Failed regIds with the rest of the possible errors (probably non-recoverable errors).