【发布时间】:2016-12-13 20:51:06
【问题描述】:
现在我可以使用 curl 命令向单个设备发送通知:
curl --header "Authorization: key=AAAxxxxxE4:xxxxxxxuXog" --header Content-Type:"application/json; application/x-www-form-urlencoded;charset=UTF-8" -d '{"to":"DeviceToken","notification":{"title":"Test","body":"Test Message","icon":"icon-192x192.png"}}' https://fcm.googleapis.com/fcm/send
这很好用。现在我尝试使用主题功能来扩展收件人的数量。
我尝试使用 curl 命令将设备添加到主题“svp”:
curl --header "Authorization: key=AAAxxxxxE4:xxxxxxxuXog" --header Content-Type:"application/json" https://iid.googleapis.com/iid/v1/DeviceToken/topics/svp
我在这里收到错误消息:
{"error":"InvalidToken"}
但我敢肯定,授权密钥和令牌都是正确的。 (我仍然可以用它发送通知)。
谁能帮我找到解决问题的方法?
【问题讨论】:
标签: php curl firebase firebase-cloud-messaging