gpt4 book ai didi

android - 用于在 Android 中发送推送通知的协议(protocol)

转载 作者:塔克拉玛干 更新时间:2023-11-02 07:58:12 25 4
gpt4 key购买 nike

我想知道哪个协议(protocol)用于向 Android 设备发送推送通知以及哪个协议(protocol)向 GCM 发送推送通知请求。

是 HTTP、HTTPS 还是其他?

最佳答案

第三方服务器和GCM服务器之间的通信协议(protocol)(HTTP或XMPP)在其他答案中已经提到。

设备和 GCM 服务器之间的通信协议(protocol)没有在 GCM 文档中讨论,因为您永远不必作为 Android 应用程序开发人员直接访问它,因此您不需要了解它。

但是,这里引用来自创建 GCM 的团队的一位 Google 开发人员的话,其中说明了一些关于连接的事情。从他的说法,你只能知道这是一个长生命周期的TCP连接。

GCM maintains a long-lived connection - and reconnects if it knows the connection was broken. A router/AP/NAT is supposed to send a FIN or RST to terminate the TCP connection - so GCM and servers will know the connection is dead.

However a number of routers and mobile operators don't do this, and then GCM needs to rely on the heartbeat, ~15 min on Wifi, more on mobile.

(引用自那个人的answer)

关于android - 用于在 Android 中发送推送通知的协议(protocol),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23077442/

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