回答

2

使用Firebase通知控制台发送消息时,目前无法设置click_action参数。

您必须在自己的App Server上构建有效负载,或者在测试时使用Postman(instructions here)或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

相关问题