C# Class C2dmSharp.Server.C2dmService

Show file Open project: Redth/C2DM-Sharp Class Usage Examples

Public Properties

Property Type Description
running bool

Public Methods

Method Description
C2dmService ( ) : System
C2dmService ( string senderID, string password, string applicationID ) : System

Ctor

QueueMessage ( C2dmMessage msg ) : void

Queues a new C2DM Message to be sent

QueueMessage ( string registrationId, NameValueCollection data, string collapseKey ) : void

Queues a new C2DM Message to be sent

QueueMessage ( string registrationId, NameValueCollection data, string collapseKey, bool delayWhileIdle ) : void

Queues a new C2DM Message to be sent

RefreshGoogleAuthToken ( ) : void

Explicitly refreshes the Google Auth Token. Usually not necessary.

SetNumberOfWorkers ( int value ) : void

Increase or decrease the number of workers to process queued messages.

Start ( ) : void
Start ( int numberOfWorkers ) : void

Starts the specified number of workers ready to send queued messages

Stop ( ) : void

Stops all workers and the service, without waiting for queued messages to be sent.

Private Methods

Method Description
init ( string senderID, string password, string applicationID ) : void
messageTransportWork ( object state ) : void

Method Details

C2dmService() public method

public C2dmService ( ) : System
return System

C2dmService() public method

Ctor
public C2dmService ( string senderID, string password, string applicationID ) : System
senderID string Email address (google account) used to sign up for Google's C2DM application Whitelist
password string Password used to login with Email
applicationID string Application (Package Name) used to sign up for Google's C2DM Whitelist
return System

QueueMessage() public method

Queues a new C2DM Message to be sent
public QueueMessage ( C2dmMessage msg ) : void
msg C2dmMessage Constructed C2dmMessage parameter
return void

QueueMessage() public method

Queues a new C2DM Message to be sent
public QueueMessage ( string registrationId, NameValueCollection data, string collapseKey ) : void
registrationId string Registration ID of the Device
data System.Collections.Specialized.NameValueCollection Key/Value Collection of data or 'extras' to send
collapseKey string Collapse Key
return void

QueueMessage() public method

Queues a new C2DM Message to be sent
public QueueMessage ( string registrationId, NameValueCollection data, string collapseKey, bool delayWhileIdle ) : void
registrationId string Registration ID of the Device
data System.Collections.Specialized.NameValueCollection Key/Value Collection of data or 'extras' to send
collapseKey string Collapse Key
delayWhileIdle bool If true, C2DM will only be delivered once the device's screen is on
return void

RefreshGoogleAuthToken() public method

Explicitly refreshes the Google Auth Token. Usually not necessary.
public RefreshGoogleAuthToken ( ) : void
return void

SetNumberOfWorkers() public method

Increase or decrease the number of workers to process queued messages.
public SetNumberOfWorkers ( int value ) : void
value int New Value for the number of workers to use
return void

Start() public method

public Start ( ) : void
return void

Start() public method

Starts the specified number of workers ready to send queued messages
public Start ( int numberOfWorkers ) : void
numberOfWorkers int Number of Workers
return void

Stop() public method

Stops all workers and the service, without waiting for queued messages to be sent.
public Stop ( ) : void
return void

Property Details

running public property

public bool running
return bool