有人知道从 Firebase 控制台发送 click_action 的一种方法吗?
我只想发送 click_action 按钮以使用通知,即使应用程序已关闭或在后台.
目前无法在使用 Firebase Notifications 控制台发送消息时设置 click_action
参数.
您必须在自己的应用服务器上构建有效负载,或使用 Postman (instructions here) 或 cURL (instructions below).
<小时><小时>通过 cURL 发送下游消息
您可以通过 cURL 发送请求来测试使用 FCM REST API 发送消息.
curl --header "授权:key="--header 内容类型:应用程序/json"https://fcm.googleapis.com/fcm/send -d "{"registration_ids":["ABC"]}"
从此处检索到的语法.
上面指出的 API_KEY
是指可以在您的 Firebase 控制台的云消息选项卡.
所在的部分:
"{"registration_ids":["ABC"]}"
是,可以替换为您自己的有效负载.有关详细信息,请参阅 FCM HTTP 协议文档.p>
Someone know one way to send the click_action from the firebase console ?
I just want to send the click_action button to use the notification even if the app is closed or in background.
There is currently no way to set the click_action
parameter when using the Firebase Notifications console to send the message.
You'll have to build the payload on your own App Server, or use Postman (instructions here) or cURL (instructions below) when testing.
Sending Downstream Messages via cURL
You can test sending messages using the FCM REST API by sending a request through cURL.
curl --header "Authorization: key=<API_KEY>"
--header Content-Type:"application/json"
https://fcm.googleapis.com/fcm/send
-d "{"registration_ids":["ABC"]}"
Syntax retrieved from here.
The API_KEY
indicated above is referring to the Server Key that can be seen in your Firebase Console's Cloud Messaging Tab.
The part where:
"{"registration_ids":["ABC"]}"
is, can be replaced with your own payload. See the FCM HTTP Protocol Documentation for more details.
这篇关于Firebase 云消息发送 click_action的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!