Android GCM推送通知 - 向特定设备而非所有设备发送通知

时间:2013-09-03 13:42:28

标签: android push-notification google-cloud-messaging

我关注了Google GCM Google Cloud Messaging for Android。但它会向所有设备而不是特定设备运行通知。如何向特定设备发送通知。

我相信我需要注册ID。但注册ID的定义是:

An ID issued by the GCM servers to the Android application that allows it to receive 
messages. Once the Android application has the registration ID, it sends it to the 
3rd-party application server, which uses it to identify each device that has registered 
to receive messages for a given Android application. In other words, a registration ID 
is tied to a particular Android application running on a particular device.

这是第三方应用程序的含义。

请指导我。 任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:2)

  

但它会向所有设备而不是特定设备运行通知

由于GCM不支持向所有设备发送通知,因此无法进行此操作。 GCM支持向特定设备或向同一用户注册的所有设备发送消息(如果您使用the opt-in user notifications feature)。

  

这是第三方应用程序的含义。

这是在the very Web page that you linked to上定义的。您可以通过阅读该页面来看出这一点,并看到:

  

第三方应用程序服务器:您在实施GCM时编写的应用程序服务器。第三方应用程序服务器通过GCM连接服务器将数据发送到设备上的Android应用程序。

相关问题