简体   繁体   English

Google Cloud Messaging Notification与数据

[英]Google Cloud Messaging Notification vs Data

I was reading the GCM documentation about the difference between notification type and data type when you want to send a message to a mobile device. 当您要向移动设备发送消息时,我正在阅读有关通知类型和数据类型之间差异的GCM文档。

They say that notification type is always collapsed but for me its not clear what it means exactly? 他们说通知类型总是折叠的,但对我来说不清楚它到底意味着什么?

Does it mean that if i send two or more notification (before the user is able to open the previous one) only the last one will be visible? 这是否意味着如果我发送两个或多个通知(在用户能够打开前一个通知之前),则只有最后一个可见?

Collapsible or Non-Collapsible 可折叠或不可折叠

The push messages can be either collapsible or non-collapsible. 推送消息可以是可折叠的或不可折叠的。 “Collapsible” means that the most recent message overwrites any previous ones queued for sending. “可折叠”表示最新消息将覆盖排队发送的所有先前消息。 A typical example of collapsible messaging is a live game score. 可折叠消息传递的典型示例是实时游戏得分。 In case previous score updates haven't reached their destination yet, the Android clients would only get the latest one. 如果以前的分数更新尚未到达目的地,则Android客户端只会获取最新的分数。 This happens however on a best effort basis: the order in which messages get sent in GCM is not guaranteed, so in some cases the “latest” message may not be actually the most recent one. 但是,这是尽力而为的:无法保证在GCM中发送消息的顺序,因此在某些情况下,“最新”消息实际上可能不是最新消息。

Notification: Set notification payload. 通知:设置通知有效载荷。 May have optional data payload. 可能具有可选的数据有效负载。 Always collapsible. 始终可折叠。

Data: Set data payload only. 数据:仅设置数据有效载荷。 Can be either collapsible or non-collapsible. 可以是可折叠的或不可折叠的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM