简体   繁体   English

没有可用数据连接的Google Cloud Messaging

[英]Google Cloud Messaging without working data connectivity

Can Google Cloud Messaging deliver a notification with "zero-byte payload" to a phone that's capable of receiving voice calls and SMS, but for whatever reason has no working data connectivity at the moment? Google云消息传递是否可以向能够接收语音呼叫和短信的手机发送“零字节有效负载”通知,但无论出于何种原因,目前还没有可用的数据连接?

By "zero byte", I mean that the phone would be aware that a GCM notification having no payload was sent to it by a specific sender, and could fire off an intent to that effect. 通过“零字节”,我的意思是电话将意识到特定发送者向其发送了没有有效载荷的GCM通知,并且可以触发该意图。

Real-world example: A burglar alarm gets triggered, and sends two push messages to the homeowner -- a zero-byte message whose meaning is implied entirely from the fact that it was sent at all, implies "something bad is happening", and can (presumably) be delivered even when data connectivity is blocked or unavailable because it (presumably) rides over the same transport layer used for SMS, and a longer push notification sent a few seconds later with additional meta-information about the situation that might only work if there's working data connectivity at the moment (so the phone could be notified, and fetch the payload from a server after establishing a conventional data session). 真实世界的例子:一个窃贼警报被触发,并向房主发送两个推送消息 - 一个零字节消息,其含义完全隐含于它完全被发送的事实,暗示“发生了一些不好的事情”,并且即使数据连接被阻止或不可用也可以(可能)被传送,因为它(可能)骑在用于SMS的相同传输层上,并且几秒钟之后发送更长的推送通知以及可能仅有的情况的附加元信息如果此时有工作数据连接,则工作(这样可以通知电话,并在建立传统数据会话后从服务器获取有效负载)。

I've read Google's docs, but it seems like they've intentionally bent over backwards to say nothing about GCM's physical transport layer. 我已经阅读了Google的文档,但似乎他们故意向后倾斜,对GCM的物理传输层一无所知。

I would have to say "No" on that, since GCM (and pretty much everything Google does) is TCP/UDP/IP-based, there's no way it can get delivered to your phone if your phone doesn't have an active data (3G/4G/WiFi) connection. 我不得不说“不”,因为GCM(以及Google所做的几乎所有事情)都是基于TCP / UDP / IP的,如果您的手机没有活动数据,则无法将其发送到您的手机(3G / 4G / WiFi)连接。

Since the phone wouldn't have an IP-address, GCM couldn't deliver the message. 由于手机没有IP地址,GCM无法传送信息。

From GCM Architectural Overview : 来自GCM Architectural Overview

  • It uses an existing connection for Google services. 它使用现有的Google服务连接。
  • No. There is no zero length message if you are using the GCM. 不可以。如果您使用GCM,则没有零长度消息。 GCM needs to aleast contain some information on what service will be recieving this message. GCM需要包含一些有关哪些服务将收到此消息的信息。
  • Notice GCM=> Google CLOUD Message . 请注意GCM => Google CLOUD消息。 Can't be cloud if you aren't connected. 如果你没有连接,不能是云。
  • GCM is a server-push. GCM是服务器推送。 Servers can't push to client if they aren't reachable. 如果无法访问,则服务器无法推送到客户端。

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

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