Share via


GooglePushMessage Class

Definition

The GooglePushMessage helps generating a notification payload targeting Google Cloud Messaging for Chrome (GCM). Notifications can be sent using the PushClient class.

[System.Serializable]
public class GooglePushMessage : System.Collections.Generic.Dictionary<string,object>, Microsoft.Azure.Mobile.Server.Notifications.IPushMessage
[<System.Serializable>]
type GooglePushMessage = class
    inherit Dictionary<string, obj>
    interface IPushMessage
Public Class GooglePushMessage
Inherits Dictionary(Of String, Object)
Implements IPushMessage
Inheritance
GooglePushMessage
Attributes
Implements

Constructors

GooglePushMessage()

Initializes a new instance of the GooglePushMessage class enabling creation of a notification message targeting Google Cloud Messaging for Chrome (GCM).Set the appropriate properties on the message and submit through the PushClient

GooglePushMessage(IDictionary<String,String>, Nullable<TimeSpan>)

Initializes a new instance of the GooglePushMessage class with a given set of data parameters and an optional timeToLive.

GooglePushMessage(SerializationInfo, StreamingContext)

Initializes a new instance of the GooglePushMessage class with the specified serialization information and streaming context.

Properties

CollapseKey

A collapse key is an arbitrary string that is used to collapse a group of like messages when the device is offline, so that only the most recent message gets sent to the client. For example, "New mail", "Updates available", and so on.

Data

A collection or name-value properties to include in the message. Properties must be simple types, i.e. they can not be nested.

DelayWhileIdle

Indicates whether the message should be delivered while the device is idle.

JsonPayload

As an alternative to building the notification by initializing the GooglePushMessage directly, it is possible to provide a complete JSON representation which will be sent to the Notification Hub unaltered.

TimeToLiveInSeconds

The Time to Live (TTL) property lets the sender specify the maximum lifespan of a message. The value of this parameter must be a duration from 0 to 2,419,200 seconds, and it corresponds to the maximum period of time for which GCM will store and try to deliver the message. Requests that don't contain this field default to the maximum period of 4 weeks.

Methods

ToString()

Provides a JSON encoded representation of this GooglePushMessage

Extension Methods

TryRemove<TKey,TValue>(Dictionary<TKey,TValue>, TKey, TValue)

Removes the value associated with specified key.

Applies to