Firebase 云消息传递 (FCM) - HTTP V1 API 还是旧版 HTTP API?

Firebase Cloud Messaging (FCM) - HTTP V1 API or Legacy HTTP API?

我们的目标是从我们的后端向组设备发送通知,并且只有从服务器端才可能知道应该接收通知的设备。

我们对 AppCenter 做了一些尝试,因为我们主要使用 Xamarin iOS/Android/Forms,但现在我们怀疑直接使用 Firebase API 可能更好,因为它更广泛、更强大。

我看到新版本的 API (HTTP V1) 无法向令牌列表发送通知,旧版 API 中使用 [=12= 提供的功能] 参数 (https://firebase.google.com/docs/cloud-messaging/send-message).

Device group name (legacy protocols only)

我无法使用主题,因为何时发送通信是服务器负责准备"mailing list" 通知的时间。

我正在考虑使用设备组消息传递 (https://firebase.google.com/docs/cloud-messaging/android/device-group),但这些是旧版 api 的一部分,我不确定它是否使 sense/it 成为可能在 API.

的新版本中使用它们

是否可以选择将一批 100-200-500 条推送通知每条发送到一个令牌?理论上可以发送的通知没有限制,但我担心发送太多可能会被禁止。

使用旧版 API 更好吗?此外,AppCenter (Microsoft) 使用旧版 API,这很明显,因为设置的工作方式以及从 AppCenter 的控制台可以将通知发送到令牌列表,Firebase 的控制台上不可用的功能。

另一个人刚刚问了类似的问题,但答案是使用主题 (How to send firebase notification for all user at a time?)。

从你在我 answer here 的评论中的 link 找到这里。在此重申我的回复,当使用 v1 向多个令牌发送消息时,现在建议的方法是使用主题消息传递,因为 registration_ids 不受支持。

Is it better to use legacy API?

v1 被描述为 more secure, cross platform, future proof way of sending messages to FCM clients。更安全,因为它使用 OAuth2 安全模型。

但是,如果您的 use-case 使用旧版 API 效果更好,那么我建议您继续使用它。

如果您想继续使用多播功能,此页面建议您应该继续使用旧版 API:https://firebase.google.com/docs/cloud-messaging/migrate-v1

Any apps that use device group messaging or multicast messaging, however, may prefer to wait for future versions of the API. HTTP v1 does not support these features of the legacy API.