【问题标题】:Firebase Cloud Messaging: notification one-to-one [duplicate]Firebase Cloud Messaging:一对一通知[重复]
【发布时间】:2023-03-20 22:08:01
【问题描述】:

如何通过 firebase 云消息将通知从 android 设备发送到另一台设备? 我不想使用 firebase 的管理面板发送通知,我只想从一台设备发送到另一台设备。

【问题讨论】:

  • 目前这个问题相当广泛。尝试添加更多细节和任何可能对其他人有用的相关代码。另请务必查看How to Askhelp center 了解更多信息。
  • 朋友,问题简单客观。我只想知道如何通过 FCM 通过 php 中的 api 从一台设备向另一台设备发送通知。

标签: android firebase push-notification firebase-cloud-messaging


【解决方案1】:

FCM 不提供设备到设备的通信,您必须通过 App Server 实现或使用 FCM 端点发送消息。

您是否实施了应用服务器?它通过 FCM 发送通知。

方法一: 如果有 App Server,那么您可以关注:https://firebase.google.com/docs/cloud-messaging/android/upstream 并在 App Server 中添加逻辑以发送通知。

方法 2: 您可以使用Firebase Remote Config 共享FCM 服务器密钥,并从android 客户端发出Http 请求。

【讨论】:

  • 您好,我在 php 中找到了一个现成的 api,可以解决我遇到的问题,通过 AndroidHive 网站上提供的教程,我将从它创建应用程序。但我只想将通知从一台设备发送到另一台设备。可以看的话点api链接:drive.google.com/file/d/1EIb5cTFABnjpdBr1BG5EiX2blOa5cNSB/…
猜你喜欢
  • 1970-01-01
  • 2021-06-28
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-12-14
  • 1970-01-01
  • 2016-11-21
  • 2016-11-03
相关资源
最近更新 更多