我正在为我的应用程序进行后台下载,但我正在
iOS payload, but nothing to deliver to (missing device_tokens, tags, segments, or aliases)
当我在终端插入它时:
curl -v -X POST -u "<appKey>:<master key>" -H "Content-type: application/json" -H "Accept:
application/vnd.urbanairship+json; version=3;" --data '{"audience":"all", "device_types" : ["ios"], "notification": {"ios": {"content-available":true, "sound": "default", "badge": 1, "message": "Hi there!", "priority":5}}}' https://go.urbanairship.com/api/push/
我想知道卷曲代码是否有任何格式错误。
终端返回:
* Hostname was NOT found in DNS cache
* Trying 23.74.208.46...
* Connected to go.urbanairship.com (23.74.208.46) port 443 (#0)
* TLS 1.2 connection using TLS_RSA_WITH_AES_256_CBC_SHA
* Server certificate: *.urbanairship.com
* Server certificate: Cybertrust Public SureServer SV CA
* Server certificate: Baltimore CyberTrust Root
* Server auth using Basic with user '<codes>'
> POST /api/push/ HTTP/1.1
> Authorization: Basic <codes>
> User-Agent: curl/7.37.1
> Host: go.urbanairship.com
> Content-type: application/json
> Accept:
> application/vnd.urbanairship+json; version=3;
> Content-Length: 143
>
* upload completely sent off: 143 out of 143 bytes
< HTTP/1.1 400 Bad Request
* Server gunicorn/0.14.5 is not blacklisted
< Server: gunicorn/0.14.5
< Vary: Authorization, Cookie
< X-Frame-Options: SAMEORIGIN
< Content-Type: text/html; charset=utf-8
< Date: Wed, 19 Nov 2014 02:19:02 GMT
< Transfer-Encoding: chunked
< Connection: close
< Connection: Transfer-Encoding
< Set-Cookie: SRV=s0196; path=/
<
* Closing connection 0
iOS payload, but nothing to deliver to (missing device_tokens, tags, segments, or aliases)
答案 0 :(得分:0)
首先,您不应该发布您的凭据供所有人查看。这可以允许任何人向您的应用用户发送通知!
其次,问题似乎是在“ios”部分中,您需要通过设备令牌,标签,细分或别名指定受众群体。这些是UA允许您识别哪些用户应该收到通知的机制。