gpt4 book ai didi

android - 谷歌云消息 : registration_ids vs. 设备组

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:23:38 28 4
gpt4 key购买 nike

我应该什么时候向 device group 发送消息?在注册 ID 列表 ( a message with registration_ids parameter ) 上?

管理设备组似乎只会增加复杂性。对于设备组,应用服务器应包含何时创建组或仅添加注册 ID 的逻辑。服务器仍然需要将注册 ID 保存在某些数据库中,此外,它现在还需要保存通知 key 。 responses似乎不太详细:未指定失败的原因,因此很难知道应该采取什么措施来防止失败(应用程序是否已卸载?注册 token 是否已过期?等)。
我错过了什么?有什么好处?

提前致谢!

最佳答案

Registration_idsDevice Group 可能很棘手,可根据开发人员的选择使用。根据此 guide 使用注册 ID 发送消息:

In this context, "simple" means messages sent from the app server to a client app on a device, as opposed to routing messages through topics or device groups.

对于 Device Group :

With device group messaging, app servers can send a single message to multiple instance of an app running on devices belonging to a group. Typically, "group" refers a set of different devices that belong to a single user. However, a group could also represent a set of devices where the app instance functions in a highly correlated manner, such as a phone with a temperature control app installed, a smart thermostat, and an automatic window opener. All devices in a group share a common notification key, which is the token that GCM uses to fan out messages to all devices in the group.

基于此发送带有 register_ID 列表的单个消息是一种更直接的方法、简单的编码和较低的 key 管理复杂性。虽然设备组处理复杂的注册设备列表(单个用户在服务器中注册了多个设备),但使用设备组会更合理。

注意:检查服务器是否可以处理这些消息类型的查询。

关于android - 谷歌云消息 : registration_ids vs. 设备组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36385358/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com