Live data from Hacker News

Push notifications from Go with Apple's new HTTP/2 protocol

github.com

1–10 of 19 posts

Re: Push notifications from Go with Apple's new HTTP/2 protocol

#2
I can see that this is a library to send Push Notifications via Apple's servers, but what does it have to do with HTTP/2? Did Apple make a new version of the notifications API that uses HTTP/2? Why wouldn't they just silently upgrade the transfer protocol on the existing service?

Re: Push notifications from Go with Apple's new HTTP/2 protocol

#3
post #2

I can see that this is a library to send Push Notifications via Apple's servers, but what does it have to do with HTTP/2? Did Apple make a new version of the notifications API that uses HTTP/2? Why wouldn't they just silently upgrade the transfer protocol on the existing service?

The previous APNS service doesn't use HTTP at all.

Re: Push notifications from Go with Apple's new HTTP/2 protocol

#4
There are few protocols that were truly worse than Apple's non-HTTP APNS protocol. You can read more at https://developer.apple.com/library/ios/documentation/Networ... , but suffice to say, the best part lies in:

If you send a notification that is accepted by APNs, nothing is returned.

If you send a notification that is malformed or otherwise unintelligible, APNs returns an error-response packet and closes the connection.

"Unintelligible" here includes of course invalid tokens, e.g. when the user uninstalls your app.

One of the upgrades was actually returning the last notification that made it through before closing the connection. Before that all you could do was add a sleep() and pray.

Re: Push notifications from Go with Apple's new HTTP/2 protocol

#6
post #3
post #2

I can see that this is a library to send Push Notifications via Apple's servers, but what does it have to do with HTTP/2? Did Apple make a new version of the notifications API that uses HTTP/2? Why wouldn't they just silently upgrade the transfer protocol on the existing service?

The previous APNS service doesn't use HTTP at all.

There is a great comparison between Apple's old and new protocols: https://dblog.laulkar.com/http2-protocol-for-apns.html

Re: Push notifications from Go with Apple's new HTTP/2 protocol

#7
post #5

How is this different from https://github.com/RobotsAndPencils/buford ?

APNS2 has a simpler interface and doesn't do things like generate website packages etc. APNS2 has better test coverage, and handles errors in a more go-like way. (Returns a response if a documented response was received from Apple, or an error where an unexpected error occurs.)

We are running this in production at http://carnival.io to send millions of notifications, to my knowledge buford has not been tested in production yet.

Re: Push notifications from Go with Apple's new HTTP/2 protocol

#9
post #7
post #5

How is this different from https://github.com/RobotsAndPencils/buford ?

APNS2 has a simpler interface and doesn't do things like generate website packages etc. APNS2 has better test coverage, and handles errors in a more go-like way. (Returns a response if a documented response was received from Apple, or an error where an unexpected error occurs.) We are running this in production at http://carnival.io to send millions of notifications, to my knowledge buford has not been tested in prod…

From a first look APNS2 seems to add very little value over bufort which we are running in production very successfully. I really wonder how you manage to send millions of notifications (over which period of time?) without much boilerplate code.

Re: Push notifications from Go with Apple's new HTTP/2 protocol

#10
post #8

I only read the title and just thought... so Apple 'invented' their own HTTP/2 protocol now. that really wouldn't surprise me. one. little. bit.

It would have surprised me but it also isn't something I would absolutely rule out a priori :)

Also, it's a pretty bad headline from what I (non-native speaker) can tell. You have a point, not quite sure why you're being downvoted.

Post reply on HN