News for hackers. Stuff that matters.
Re:HTTP/2 Protocol for iOS Push Notifications by Sidnicious on Thursday February 25, 2016 @12:53PM (#11176203)
For anyone who's not familiar with APNs, this new protocol is a huge improvement. Since it uses HTTP/2, you can just use an existing HTTP library (which should handle reusing the connection for multiple notifications, too).

Here's an example client that I wrote in Go for a client that doesn't have access to an HTTP/2 library. It listens for JSON on stdin. I highlighted the guts:

https://github.com/Sidnicious/pushprovider/blob/49b1f6329522...

Re:HTTP/2 Protocol for iOS Push Notifications by jamieb007 on Thursday February 25, 2016 @02:41PM (#11177174)
> "example client that I wrote in Go for a client that doesn't have access to an HTTP/2 library"

on line 62 you do specify HTTP/2: Transport: &http2.Transport

> "Since it uses HTTP/2, you can just use an existing HTTP library (which should handle reusing the connection for multiple notifications, too)."

I doubt many non-HTTP/2 implementations will keep connections open and continually check for more data - why wait and read for Response(s) if no Requests were sent? Let alone an HTTP version sent they do not understand.

Re:HTTP/2 Protocol for iOS Push Notifications by Sidnicious on Thursday February 25, 2016 @03:24PM (#11177512)
That was confusing. The second “client” means “a company for whom I did programming work”. Their environment doesn’t support HTTP/2 directly, so I wrote this standalone tool. By “existing HTTP library”, I mean one which supports HTTP/2 — instead of a special-purpose library for talking to APNs over its old binary protocol.