JPush(1.6.0)清除角标报错

landmass
2017-08-22 09:12 2k 0

1、集成JPush(1.6.0);
2、我们使用 curl 命令 清空 App badge number(角标)
curl --insecure -X POST -v https://api.jpush.cn/v3/push -H "Content-Type: application/json" -u "0c7cfd1e2fddf7122754d35c:masterSecret" -d {"platform":"ios","audience": {"registration_id" : ["1507bfd3f7f12ca0eea"]},"notification":{"ios":{"alert":"","sound": "default","badge":"0"}}}
报错:

    Note: Unnecessary use of -X or --request, POST is already inferred.
*   Trying 113.31.136.60...
* TCP_NODELAY set
* Connected to api.jpush.cn (113.31.136.60) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* ALPN, server accepted to use h2
* Server certificate:
*  subject: C=CN; ST=GuangDong; L=Shenzhen; O=Shenzhen HeXunHuaGu Information Te
chnologies Co.Ltd; CN=*.jpush.cn
*  start date: Jul 17 00:00:00 2017 GMT
*  expire date: Jul 16 23:59:59 2020 GMT
*  issuer: C=US; O=GeoTrust Inc.; CN=GeoTrust SSL CA - G3
*  SSL certificate verify result: unable to get local issuer certificate (20), c
ontinuing anyway.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0

* Server auth using Basic with user '0c7cfd1e2fddf7122754d35c'
* Using Stream ID: 1 (easy handle 0x5e97f0)
> POST /v3/push HTTP/2
> Host: api.jpush.cn
> Authorization: Basic MGM3Y2ZkMWUyZmRkZjcxMjI3NTRkMzVjOjI2NGVkYWQ5MjQ0ZjMzYTc0
zNhNjRmYQ==
> User-Agent: curl/7.55.1
> Accept: */*
> Content-Type: application/json
> Content-Length: 23
>
* Connection state changed (MAX_CONCURRENT_STREAMS updated)!
* We are completely uploaded and fine
< HTTP/2 400
< server: nginx
< date: Tue, 22 Aug 2017 08:56:02 GMT
< content-type: application/json
< x-rate-limit-limit: 600
< x-rate-limit-remaining: 599
< x-rate-limit-reset: 60
< x-jpush-msgid:
<
{"error": {"message": "Missing parameter", "code": 1002}}* Connection #0 to host
 api.jpush.cn left intact
curl: (3) [globbing] unmatched brace in column 1
Note: Unnecessary use of -X or --request, POST is already inferred.
* Bad URL, colon is first character
* Closing connection -1
curl: (3) Bad URL, colon is first character
curl: (3) [globbing] bad range in column 2
curl: (3) [globbing] unmatched close brace/bracket in column 16

我可能的错误在哪呢?

1个回答

热门排序
  • 你传的registrationID是Android的ID,而你推送的内容里面只有对iOS附的值!