GCM连接服务器如何将消息发送到Android设备? [英] How GCM connection Servers sends messages to an Android device?

查看:112
本文介绍了GCM连接服务器如何将消息发送到Android设备?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在阅读关于Google Cloud Messaging(GCM)的消息。 GCM连接服务器收到的推送通知将发送到启用了GCM的Android设备。我假设它在内部使用设备ID(然后使用ARP协议从MAC解析为IP)来发送推送通知。 GCM使用哪种协议来交付通知?如果它是TCP / IP,那么它如何解析设备的IP(这不是唯一的,因为用户切换wifi网络和手机数据)。

任何人都可以帮助我了解从GCM到客户的沟通情况?

解决方案


  • (没有Google Play服务的情况下无GCM)
  • 设备通过端口5228上的 TCP连接到Google Play服务
  • 设备每隔28分钟在移动设备上发送一个心跳数据包至Google Play服务,并在WiFi上每15分钟发送一次 如果设备网络状态发生变化,该设备必须重新建立与Google Play服务的TCP连接,该连接显然可能导致问题

  • 您可以检查连接状态,心跳间隔,co连接地址和端口等。在设备上拨号 *#*#426#*#*


您可以在Google产品论坛的这篇文章中找到更多信息


I was reading about Google Cloud Messaging(GCM). The push notifications received by GCM Connection Servers are sent to GCM enabled Android device. I assume that internally it uses device Id(and then resolving to IP from MAC using ARP protocol) to send the push notifications. Which protocol GCM uses internally to deliver notifcations? If it is TCP/IP then how it resolves IP of the device(which is not unique given that a user switches wifi networks and mobiles data).

Can anyone help me understand the communication from GCM to the client?

解决方案

  • GCM works through Google Play Services (no GCM without Google Play Services)
  • Devices connect to Google Play Services through TCP on port 5228 (443 as fallback)
  • Device sends a heartbeat packet to Google Play Services every 28 minutes on mobile and 15 minutes on wifi
  • If device network state changes, the device has to reestablish a TCP connection to Google Play Services, which apparently can lead to problems
  • You can check the connection state, heartbeat interval, connection address and port, etc. dialing *#*#426#*#* on a device

You can find some more information in this post on Google Product Forums.

这篇关于GCM连接服务器如何将消息发送到Android设备?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆