【问题标题】:Android GCM push notifications - sending notification to a specific device instead of all devicesAndroid GCM 推送通知 - 将通知发送到特定设备而不是所有设备
【发布时间】:2013-09-03 13:42:28
【问题描述】:

我关注了 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.

这里的3rd party Application是什么意思。

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

【问题讨论】:

  • 将您复制的定义中的“服务器端”一词替换为“3rd-party application server”。注册 ID 是设备 ID+应用程序的组合,它是唯一且理想的在您的服务器端使用它,以便识别您与服务器交互的人。看看这个image to undersand it

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


【解决方案1】:

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

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

这里的3rd party Application是什么意思。

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

第 3 方应用服务器:您编写的应用服务器,作为实现 GCM 的一部分。第三方应用服务器通过 GCM 连接服务器向设备上的 Android 应用发送数据。

【讨论】:

    猜你喜欢
    • 2017-01-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-11-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多