我正在测试iOS开发的推送通知,目前正在使用Pusher。当我在终端中运行此命令时
curl -H "Content-Type:application/json" -H "Authorization: Bearer 7FF3763C208E26F2198CE44624E9486B1EC8B02A489DCF2F476FD511763887AE" -X POST 'https://d3ca6e4b-3222-49c9-8028-f9c2d28b3ad7.pushnotifications.pusher.com/publish_api/v1/instances/d3ca6e4b-3222-49c9-8028-f9c2d28b3ad7/publishes' -d@publish-body.json
它给了我这个警告
Warning: Couldn't read data from file "publish-body.json", this makes an empty
Warning: POST.
{"error":"Bad Request","description":"Failed to read body as a JSON
object"}
这是我的JSON文件
{
"interests": [
"Reminder"
],
"apns": {
"aps": {
"alert": {
"title": "Hello",
"body": "Hello, world!"
}
}
}
}
我尝试使用Pusher API,它告诉我的所有错误是由于错误的请求所致。有想法该怎么解决这个吗?这个程序是送给我女朋友的礼物,我很想让这个工作!