我应该何时使用GCM设备组与主题? [英] When should I use GCM device groups versus topics?

查看:96
本文介绍了我应该何时使用GCM设备组与主题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在考虑将Google Cloud Messaging整合到我的应用中。我想发送消息给与用户相关的所有设备。起初,它看起来像GCM的设备组消息将是一条路。但是这需要在我的服务器上管理注册ID和通知密钥。似乎使用GCM的主题消息更容易,其主题是键入一些共享用户信息,如用户ID。



我打算使用GCM向Android和iOS应用发送数据。我将发送背景可用内容(使用Apple推送通知术语)消息和用户可见通知。

有什么好处,如果有的话,设备组消息传递给主题消息传递?

解决方案

我认为以下第一点是唯一有所作为的地方



https:// firebase .google.com / docs / cloud-messaging / android / topic-messaging
$ b



  • 主题消息针对吞吐量而不是延迟进行了优化。对于
    的快速,安全交付到单个设备或小组设备,
    将消息定位到注册令牌,而不是主题。

  • 如果您需要
    将消息发送给每个用户的多个设备,请考虑设备组
    为这些用例进行消息传递。

  • ul>


I am looking into incorporating Google Cloud Messaging into my app. I would like to send messages to all devices associated with a user. At first, it looked like GCM's device group messaging would be the way to go. But that requires managing registration IDs and notification keys on my server. It seems like it'd be easier to use GCM's topic messaging where the topic is keyed on some shared user information like a user ID.

I intend to use GCM to send data to both Android and iOS apps. I will be sending both background "content available" (to use the Apple Push Notification terminology) messages and user-visible notifications.

What advantages are there, if any, of device group messaging over topic messaging?

解决方案

I think the first point below is the only thing that makes any difference

https://firebase.google.com/docs/cloud-messaging/android/topic-messaging

  • Topic messages are optimized for throughput rather than latency. For fast, secure delivery to single devices or small groups of devices, target messages to registration tokens, not topics.
  • If you need to send messages to multiple devices per user, consider device group messaging for those use cases.

这篇关于我应该何时使用GCM设备组与主题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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