有人知道从firebase控制台发送click_action的一种方法吗?
即使应用已关闭或在后台,我也只想发送click_action按钮来使用通知。
答案 0 :(得分:2)
使用Firebase Notifications控制台发送邮件时,目前无法设置click_action
参数。
您必须在自己的App Server上构建有效负载,或在测试时使用Postman(instructions here)或cURL(以下说明)。
通过cURL发送下游消息
您可以通过cURL发送请求来测试使用FCM REST API发送消息。
curl --header "Authorization: key=<API_KEY>" \
--header Content-Type:"application/json" \
https://fcm.googleapis.com/fcm/send \
-d "{\"registration_ids\":[\"ABC\"]}"
从here。
中检索的语法上面指出的API_KEY
指的是可以在Firebase Console's Cloud Messaging Tab中看到的服务器密钥。
部分:
"{\"registration_ids\":[\"ABC\"]}"
是,可以用您自己的有效负载替换。有关详细信息,请参阅FCM HTTP Protocol Documentation。