我正在尝试使用Postman来发送一条使用Firebase
Cloud Messaging服务的推送通知。
这是一条可用的cURL
命令,我将其用作参考。
curl -X POST --header "Authorization: key=<API_ACCESS_KEY>" --Header "Content-Type: application/json" https://fcm.googleapis.com/fcm/send -d "{\"to\":\"<YOUR_DEVICE_ID_TOKEN>\",\"notification\":{\"body\":\"Firebase\"} \"priority":\"10"}"
到目前为止我所做的...
1 - 适当地设置标题
2- 在正文中,我正在使用raw
{
"to" : "<YOUR_DEVICE_ID_TOKEN>"
,
"notification": {
"body": "Firebase Cloud Message"
}
}
执行时,我得到了401 - 未经授权
的返回信息。正确发送推送通知需要什么?