I would like to know if someone was able to successfully send a push notification through the new APNS API (HTTP2) using CURL.
Sample request submitted on APNs provider API page
Here's how the request should be:
HEADERS
\- END_STREAM \+ END_HEADERS :method = POST :scheme = https :path = /3/device/00fc13adff785122b4ad28809a3420982341241421348097878e577c991de8f0 host = api.development.push.apple.com apns-id = eabeae54-14a8-11e5-b60b-1697f925ec7b apns-expiration = 0 apns-priority = 10 content-length = 33
DATA
\+ END_STREAM { "aps" : { "alert" : "Hello" } }
But with the following command, I get the error "curl: (16) HTTP / 2 stream 1 was not closed cleanly: error_code = 8":
curl \ --verbose \ --http2 \ --cert <APPLICATION_CERT_FILE> \ --key <APPLICATION_KEY_FILE> \ --header "Content-Type: application/json" \ --header ":method: POST" \ --header ":path: /3/device/<DEVICE ID>" \ --data '{ "aps" : { "alert" : "Hello" } }' \ https://api.development.push.apple.com
Any tips?
source share