JPush(1.6.0)清除角标报错


(梦回秦殇) #1

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

我可能的错误在哪呢?


极光产品相关提问简要说明
#2

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


(梦回秦殇) #3

抱歉我的错误。检查之后 registrationID: 171976fa8ab5bea580f 更之后仍然报错,错误信息没有改变


#4

我换成我自己的调用验证和registrationID测试, 是OK的


(梦回秦殇) #7

您使用的是什么界面工具?我们使用的是 curl-7.55.1-win64 ,我们可以使用您的工具吗,同时授权您执行某些操作


(梦回秦殇) #8

我多次尝试官方文档中的实例,也是失败的。 https://docs.jiguang.cn/jpush/server/push/server_overview/


#9

我用的postman,这个网上有。

你检查

这里面提到的有可能的原因吧