【发布时间】:2016-12-14 12:18:30
【问题描述】:
我正在尝试使用Postman 通过Firebase 云消息服务发送单个推送通知。
这是用于同一目的的有效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- 在 Body ,我使用的是raw
{
"to" : "<YOUR_DEVICE_ID_TOKEN>"
,
"notification": {
"body": "Firebase Cloud Message"
}
}
执行时,我会返回401 - Unauthorized。
正确发送推送通知缺少什么?
【问题讨论】:
-
{ "multicast_id": 4790719999662534961, "success": 0, "failure": 1, "canonical_ids": 0, "results": [ { "error": "InvalidRegistration" } ] }这个错误
-
这篇文章对你有帮助:medium.com/android-school/…
-
这个答案可以提供帮助:stackoverflow.com/a/62670409/1151916
标签: curl firebase postman firebase-cloud-messaging