如何在不托管服务器的情况下不使用 FCM 发送一对一的上游消息?

How to send one-to-one upstream messaging using not not using FCM without hosting a server?

Sending messages from one device directly to another device it not supported through Firebase Cloud Messaging. -- Frank van Pufflenen - JUNE 23 2016

那是很久以前的事了,文档中没有任何更新。然而:

发生了很多变化。

但是:

  1. 从一台设备向另一台设备发送消息仍然需要使用服务器密钥,这意味着您将需要一个受信任的服务器。

  2. 在 Stack Overflow 上推荐服务是题外话。

  3. Firebase 服务器 SDK 用于受信任的服务器。

  4. 不,只能通过 Google 云消息传递使用受信任的服务器向设备发送消息。

关于发送下游消息的架构,另见我在这里的回答: