let httpClient = try FoundationClient.makeService(for:app)
let url = "https://api.development.push.apple.com/3/device/454654654654"
let response = httpClient.post(url)
response.do { response in
debugPrint(response)
}.catch { error in
debugPrint(error)
}
RESPONSE in macOS
HTTP/1.1 403
apns-id: 96158C63-8064-D88B-C475-F2E32247F55D
content-length: 33
{"reason":"MissingProviderToken"}
RESPONSE in Ubuntu 16.04
HTTP/1.1 200
content-length: 107
Apple's APNS requires HTTP/2 for this protocol to work. @Andrewangeta mentioned to me that Vapor 3 was supposed to be getting a native HTTP/2 client, so if thats the case, this will make this all function correctly, otherwise you still have to install cURL with HTTP/2 support
We _were_ planning on HTTP/2 with 3.0.0 release, but that was before NIO. NIO's HTTP/2 support will be coming very soon though!
Closing in favor of https://github.com/vapor/vapor/issues/1650
Most helpful comment
We _were_ planning on HTTP/2 with 3.0.0 release, but that was before NIO. NIO's HTTP/2 support will be coming very soon though!