【发布时间】:2019-11-06 05:12:41
【问题描述】:
我正在尝试将 firebase 推送通知集成到我的 react js 应用中。
我已按照以下教程进行操作
https://dzone.com/articles/how-to-add-push-notifications-on-firebase-cloud-me
https://github.com/pavelpashkovsky/react-fcm
在Token receiving 之前一切正常。
然后我尝试使用curl 脚本发送通知,如下所示
curl -X POST -H "Authorization: key=AAAAAJjqjp4:APA91bFeAaBEuHXFbcDPBgFs4p......END2341BK8HLL0uMum4" -H "Content-Type: application/json" \
-d '{
"data": {
"notification": {
"title": "FCM Message",
"body": "This is an FCM Message",
"icon": "/itwonders-web-logo.png",
}
},
"to": "cG9xo6CkVNs:APA91bEd3ypeXN8P-6dbWQWf0.......NOyIytfm"
}' https://fcm.googleapis.com/fcm/send
但我得到以下回应
{
"multicast_id": 6820287658870793009,
"success": 0,
"failure": 1,
"canonical_ids": 0,
"results": [
{
"error": "AuthenticationError"
}
]
}
【问题讨论】:
标签: reactjs firebase push-notification firebase-cloud-messaging google-cloud-messaging