When should I use GCM device groups versus topics?

蓝咒 提交于 2019-12-21 05:11:29

问题


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?


回答1:


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.


来源:https://stackoverflow.com/questions/34029367/when-should-i-use-gcm-device-groups-versus-topics

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!