ostinelli / apnotic

A Ruby APNs HTTP/2 gem able to provide instant feedback.
MIT License
479 stars 94 forks source link

NoMethodError: undefined method "on" for NetHttp2 #67

Closed brianinator closed 6 years ago

brianinator commented 6 years ago

I'm trying to use socket error callback and NoMethodError thrown during the execution of it during a Sidekiq job.

connection.on(:error) do |exception|
  logger.error("exception has been raised: #{exception}")
end

Also, tried from documentation:

connection.on(:error) { |exception| puts "Exception has been raised: #{exception}" }

Gem versions:

    apnotic (1.3.1)
      connection_pool (~> 2.0)
      net-http2 (>= 0.17, < 2)

Edit: I'm using the token based APNS method. I can see :on when I log connection.methods

brianinator commented 6 years ago

Ok so my mistake, I had net-http2 gem listed elsewhere in Gemfile.lock with a version 0.14.1 and client.on which connection.on wraps was introduced in v0.15.0.