-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
payload error #7
Comments
@carlhung thank you for your feedback I fixed documentation first to remove double dots inside name file issue ( https://github.com/boostcode/Tori-APNS/blob/master/README.md ). When it raises Connection #0 as far as I remember it means that it works fine, but I think the issue is with PUSH UUID format, try to remove the minus inside |
the UUID I didn't provide. as I read the document from Apple. apns-id can be ignored. and apple apn server will provide one. the UUID above was returned by apple. and I also tried to modify the payload format as I saw "{"reason":"PayloadEmpty"}", still couldn't make it. |
let's try to debug in this way: are certificates for |
yes, for development. |
I googled about this error, some said it is because of the version of curl. thanks. |
Yep at that time it was needed to force the http2 protocol to add that tweak |
but the project i am already using IBM's. but how can I change to use yours? as KITURA's so many modules IBM's CCurl. |
It is a still pending issue that one swift package manager, it force you to use only library, you can't use more than one. |
anyway, thanks. |
Hey,
sorry to disturb you.
I installed swift complier of version 3.1.1 on Ubuntu in order to run the code.
certificate is good although I found some problem. also, installed http2, etc. all the components I need.
now, I can successfully use the certificate.
but I encountered another error message from curl.
there is the code I used:
// the token is work, i used other application to test the token.
let token = "8fcf2f3a21102db657da053870781bb4164bce650ab8afd77de24ce52f796848"
let push = APNS(withCerts: APNSCertificate(certPath: "/home/carl/swift/time/pem/crt.pem",
keyPath: "/home/carl/swift/time/pem/key.pem
)
)
let payload = APNSPayload(withText: "Test")
push.send(payload: payload, to: token)
I got following error:
CApath: none
< HTTP/2.0 200
HTTP/2.0 200
< apns-id:F6303094-AA99-B6EF-D603-03A751EB391C
apns-id:F6303094-AA99-B6EF-D603-03A751EB391C
<
ret = CURLcode(rawValue: 0)
------------------------------the error message can be different, some time:-----------------------
...
Content-Length: 0
< HTTP/2.0 400
HTTP/2.0 400
< apns-id:0D66D5A3-2909-D13A-F1DD-0F9234DA883F
apns-id:0D66D5A3-2909-D13A-F1DD-0F9234DA883F
<
{"reason":"PayloadEmpty"}* Closing connection 0
ret = CURLcode(rawValue: 0)
-------------------------------------sometime:---------------------------------------------------
Content-Length: 3
< HTTP/2.0 200
HTTP/2.0 200
< apns-id:9C2EC37B-4DEF-ACFF-3C20-A3C491C6A3BC
apns-id:9C2EC37B-4DEF-ACFF-3C20-A3C491C6A3BC
<
ret = CURLcode(rawValue: 0)
but the way, I found a bug if the file names of the key and certificate have more than two dots like:
xxx.xxx.pem // that causes unable to open the file.
xxx.pem // that is work.
The text was updated successfully, but these errors were encountered: