GCM - 1个电子邮件注册在2个设备 [英] GCM - 1 email registered at 2 devices

查看:151
本文介绍了GCM - 1个电子邮件注册在2个设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为我的应用程序实施了GCM。我有这样的情况:

I implemented GCM for my application. I have a situation which the flow:


  1. 我有两个设备(设备A和设备B)。


  2. 设备A已登录(在GCM服务器中注册的电子邮件= abc@domain.com)。

  3. >设备B使用相同的电子邮件(abc@domain.com)登录。

  4. 我尝试将消息发送到abc@domain.com,但只有设备B收到消息。 li>
  1. I have two devices (Device A and Device B).
  2. App installed in both device.
  3. Device A logged-in (Email which registered in GCM server = abc@domain.com).
  4. Device B logged-in using same email (abc@domain.com).
  5. I tried to send message to abc@domain.com, but only device B receive the message.

那么,我该如何实现GCM,以便设备A和B都能收到消息?

So, how can I implement GCM so that both device A and B receive the message?

推荐答案

您可以使用GCM的设备组消息 a>。
$ b

You can use GCM's Device Group Messaging.


通过设备组消息,应用服务器可以将单条消息发送到属于组的设备上运行的应用的多个实例。通常,组是指属于单个用户的一组不同设备。但是,一个组也可以代表一组设备,其中应用实例以高度相关的方式运行,例如安装了温度控制应用的手机,智能恒温器和自动开窗器。

With device group messaging, app servers can send a single message to multiple instance of an app running on devices belonging to a group. Typically, "group" refers a set of different devices that belong to a single user. However, a group could also represent a set of devices where the app instance functions in a highly correlated manner, such as a phone with a temperature control app installed, a smart thermostat, and an automatic window opener. All devices in a group share a common notification key, which is the token that GCM uses to fan out messages to all devices in the group.












$ b

您必须为每个设备获取注册令牌,并使 notification_key 标识设备组。

设备群组消息最多可以注册20个设备。如果您需要超过20台设备才能接收信息,则可以使用主题信息功能。

Device Group Messaging can register up to 20 devices. If you need more than 20 devices to receive the message you can instead use Topic Messaging.

这篇关于GCM - 1个电子邮件注册在2个设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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