I am trying to use the new Apple Push Notification API, which is based on HTTP/2.
I found the http-2 Ruby gem, but the documentation isn’t clear about how to make requests as a client.
How to make a HTTP/2 request in Ruby/Rails?
I am trying to use the new Apple Push Notification API, which is based on HTTP/2.
I found the http-2 Ruby gem, but the documentation isn’t clear about how to make requests as a client.
How to make a HTTP/2 request in Ruby/Rails?
I’ve been working on a client implementation for this: https://github.com/alloy/lowdown.
Thus far I have been extensively testing it, but it won’t be deployed into production until next week. I’d love for it to get more testing, feedback, etc.
There is an example of creating HTTP/2 client in this file. It could be adapted to APN requests like this:
DISCLAIMER: I'm the author of the two gems listed here below.
If you want to issue HTTP/2 calls, you may consider NetHttp2, a HTTP/2 client for Ruby.
Usage example for sync calls:
On top of writing the HTTP/2 calls yourself, if you want an Apple Push Notification gem that uses the new HTTP/2 specifics and can be embedded in a Rails environment then you may also consider Apnotic.
Usage is very simple:
Here is how you do it using
async-http
:This will negotiate HTTP/1, HTTP/2 and SSL as required.