google-app-engine - 如何从 Java Appengine 发送 GCM 主题消息

标签 google-app-engine google-cloud-messaging

要发送一个正常的 GCM,我可以做

Sender sender = new Sender(apiKey);
Message message = new Message.Builder()
    .addData("message", "this is the message")
    .addData("other-parameter", "some value")
    .build();
Result result = sender.send(message, registrationId, numOfRetries);

谁能告诉我如何从 Appengine (Java) 发送主题消息

最佳答案

您可以使用此版本的 Java GCM library .它很快就会被合并到主分支中。它支持主题消息传递。要发送主题消息,只需将主题设置为“收件人”字段即可。例如:/topics/mytopic

Sender sender = new Sender(apiKey);
sender.send(message, topic);

关于google-app-engine - 如何从 Java Appengine 发送 GCM 主题消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33314094/

相关文章:

javascript - 用于 Google App Engine channel API 客户端的无窗口容器

python - 使用 memcache.add() 而不是 set()

android - 谷歌云消息不发送通知

android - 有时在移动设备中不接收推送通知 GCM

mysql - 非常大的mysql插入查询需要生命周期来执行

google-app-engine - XMPP 和 Google App Engine 的 Channel API 之间的差异

android - 部署到 App Engine 问题 - 您必须登录才能执行此操作

PHP:如何在一个帖子中向多个设备发送 GCM 通知

java - 将 XML 转换为对象的最佳方式

android - 在 Android 上实现推送通知的简单方法