![](/img/trans.png)
[英]How to subscribe to topics with web browser using Firebase Cloud Messaging
[英]How to use firebase cloud messaging over web
我是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"
}
请告诉我我必须在哪个文件中编写此代码。
任何帮助将不胜感激。
这是一个示例有效负载(请参阅此处的参数)。 您可以从自己的App Server生成请求,也可以在开发过程中使用Postman或cURL简单地发送下游消息。
还有使用Firebase Notifications Console的选项。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.