gpt4 book ai didi

Android gcm 通知有效负载与数据有效负载?

转载 作者:太空宇宙 更新时间:2023-11-03 11:43:10 25 4
gpt4 key购买 nike

根据 https://developers.google.com/cloud-messaging/server-refgcm 消息可以有通知负载或/和数据负载这两者有什么区别?

最佳答案

阅读您发送的链接在 Payload section 下进行了解释

Payload

Optional. If you are including a payload in the message, you use the data parameter to include your custom key/value pairs. The client app handles the data payload for display or other processing purposes.

The notification parameter with predefined options indicates that GCM will display the message on the client app’s behalf if the client app implements GCMListenerService on Android, or if the notification message is sent to an iOS device. This applies for both HTTP and XMPP.

The app server can send a message including both notifications and data payloads. In such cases, GCM handles displaying the notification payload and the client app handles the data payload.

See the Server Reference for details on sending and receiving messages.

关于Android gcm 通知有效负载与数据有效负载?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30586892/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com