首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >iOS有效负载,但没有要传送的内容(缺少device_tokens、标记、段或别名)

iOS有效负载,但没有要传送的内容(缺少device_tokens、标记、段或别名)
EN

Stack Overflow用户
提问于 2014-11-19 10:30:51
回答 1查看 228关注 0票数 0

我正在为我的应用程序进行后台下载,但我正在

代码语言:javascript
复制
iOS payload, but nothing to deliver to (missing device_tokens, tags, segments, or aliases) 

当我在终端中插入以下内容时:

代码语言:javascript
复制
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/

我想知道curl代码中是否有任何格式错误。

终端返回:

代码语言:javascript
复制
 * 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)
EN

回答 1

Stack Overflow用户

发布于 2014-11-19 15:48:26

首先,你不应该张贴你的证书让所有人看到。这可以让任何人向你的应用程序用户发送通知!

其次,问题似乎是,在您的"ios“部分中,您需要通过设备令牌、标签、细分市场或别名来指定您的受众。这些是UA提供给您的机制,用于确定哪些用户应该接收通知。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/27007930

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档