【问题标题】:How to use firebase cloud messaging over web如何通过网络使用 Firebase 云消息传递
【发布时间】:2017-06-14 12:49:57
【问题描述】:

我是 firebase 的新手,想通过 firebase 云消息在浏览器上显示通知,但问题是我混淆了在哪里编写此代码 ::

POST /fcm/send HTTP/1.1
Host: fcm.googleapis.com
Content-Type: application/json
Authorization: key=YOUR_SERVER_KEY

{
  "notification": {
    "title": "New chat message!",
    "body": "There is a new message in FriendlyChat",
    "icon": "/images/profile_placeholder.png",
    "click_action": "http://localhost:5000"
  },
  "to":"YOUR_DEVICE_TOKEN"
}

请告诉我必须在哪个文件中编写此代码。

任何帮助将不胜感激。

【问题讨论】:

    标签: javascript firebase firebase-cloud-messaging


    【解决方案1】:

    这是一个示例负载(请参阅参数here)。您可以从自己的 App Server 生成请求,或者在开发过程中您可以简单地发送下游消息 using PostmancURL

    还有使用Firebase Notifications Console的选项。

    【讨论】:

      猜你喜欢
      • 2021-06-30
      • 2021-07-22
      • 2023-02-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-04
      • 1970-01-01
      • 2016-12-25
      相关资源
      最近更新 更多