参考资料:https://github.com/firebase/quickstart-js/tree/master/messaging
我已添加了键值对:
"requireInteraction": true
但是在桌面版Chrome中的通知仍会在20秒后消失。是否有人知道Firebase是否支持该键值对?谢谢!
以下是我的示例。请将[...]
更改为您自己的内容。
curl -X POST -H "Authorization: key=[...]" -H "Content-Type: application/json" -d '{
"notification": {
"requireInteraction": true,
"title": "This is custom title",
"body": "this is custom body",
"click_action": "https://google.com",
"data" : {"requireInteraction": true }
},
"to": "[...]",
}' "https://fcm.googleapis.com/fcm/send"
requireInteraction
。它只应在构建通知时声明。如果问题仅涉及支持,则requireInteraction
不属于notification
负载,但可以存在于data
负载中。 :) - AL.