firebase - Firebase 云消息传递 cURL POST 显示错误 403
问题描述
我是 cURL 和 Firebase 的新手。我正在尝试使用 Powershell 使用https://firebase.google.com/docs/cloud-messaging/js/first-message#curl中的以下代码发送 FCM 测试消息(我必须修复一个关闭的位置括号)
这是我正在使用的代码 -
curl -X POST -H "Authorization: Bearer ya29.c.KpAB...." -H "Content-Type: application/json" -d '{
"message":{
"notification": {
"title": "FCM-Message",
"body": "This-is-a-message-from-FCM"
},
"webpush": {
"headers": {
"Urgency": "high"
},
"notification": {
"body": "This-is-a-message-from-FCM-to-web",
"requireInteraction": "true",
"badge": "/badge-icon.png"
}
},
"token": "fG7.....",
}
}' https://fcm.googleapis.com/v1/projects/project-f0994/messages:send
但由于某种原因,我收到了这个错误:
{
"error": {
"code": 403,
"message": "Request had insufficient authentication scopes.",
"status": "PERMISSION_DENIED"
}
}
我无法弄清楚我可能做错了什么。谢谢。
解决方案
推荐阅读
- accessibility - 我可以使用 aria- describeby 引用多个元素吗?
- c# - 动态下拉菜单中的多个选项
- javascript - 在 href 中调用 auth0 登录
- python - 如何将使用连字符的对象数据类型列转换为日期时间?
- javascript - 嵌套路由和 Switch - 如何传递 props.match.params.id?
- xml - 使用 XML 转换更改我的 web.config 中的服务端点地址
- tizen - 通过 artik cloud 获取 gear s3 数据
- json - 如何创建招摇阵列
- python - 如何清除scrapy工作列表?
- c++ - C ++是否可以拥有动态默认数据成员