Firebase Cloud Messaging发送click_action [英] Firebase Cloud Messaging send click_action
问题描述
有人知道从firebase控制台发送click_action的一种方法吗?
我只想发送click_action按钮以使用通知,即使该应用已关闭或在后台运行.
使用Firebase Notifications控制台发送消息时,目前无法设置click_action
参数.
您必须在自己的App Server上构建有效负载,或使用Postman(
从此处检索的 语法. > 上面指出的 其中的部分: 是,可以用您自己的有效负载替换.有关更多详细信息,请参见 FCM HTTP协议文档.API_KEY
指的是服务器密钥,可以在您的."{\"registration_ids\":[\"ABC\"]}"
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 Cloud Messaging发送click_action的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!