你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

GooglePushMessage 类

定义

可帮助 GooglePushMessage 生成面向 Chrome (GCM) 的 Google Cloud Messaging 的通知有效负载。 可以使用 类中提供的 ApiServices 类发送PushClient通知。

[System.Serializable]
public class GooglePushMessage : System.Collections.Generic.Dictionary<string,object>, Microsoft.WindowsAzure.Mobile.Service.Notifications.IPushMessage
[<System.Serializable>]
type GooglePushMessage = class
    inherit Dictionary<string, obj>
    interface IPushMessage
Public Class GooglePushMessage
Inherits Dictionary(Of String, Object)
Implements IPushMessage
继承
GooglePushMessage
属性
实现

构造函数

GooglePushMessage()

初始化 类的新实例 GooglePushMessage ,以便创建面向 Chrome (GCM) 的 Google Cloud Messaging 的通知消息。在消息上设置适当的属性,并通过 提交 PushClient

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

使用给定的参数 GooglePushMessagedata 和可选的 timeToLive初始化 类的新实例。

GooglePushMessage(SerializationInfo, StreamingContext)

使用指定的序列化信息和流上下文初始化 GooglePushMessage 类的新实例。

属性

CollapseKey

折叠键是一个任意字符串,用于在设备脱机时折叠一组类似消息,以便仅将最新的消息发送到客户端。 例如,“新邮件”、“汇报可用”等。

Data

要包含在消息中的集合或名称值属性。 属性必须是简单类型,即不能嵌套。

DelayWhileIdle

指示是否应在设备空闲时传递消息。

JsonPayload

作为通过直接初始化 GooglePushMessage 生成通知的替代方法,可以提供完整的 JSON 表示形式,该表示形式将不更改地发送到通知中心。

TimeToLiveInSeconds

生存时间 (TTL) 属性允许发送方指定消息的最长生存期。 此参数的值必须是 0 到 2,419,200 秒的持续时间,它对应于 GCM 将存储和尝试传递消息的最长时间。 不包含此字段的请求默认为最长 4 周。

方法

ToString()

提供此的 JSON 编码表示形式 GooglePushMessage

适用于