class APN::Feedback
Public Class Methods
new(options = {})
click to toggle source
# File lib/apn/feedback.rb, line 12 def initialize(options = {}) options[:host] ||= 'feedback.push.apple.com' options[:port] ||= 2196 options[:password] ||= '' @cert = options[:cert] @password = options[:password] @host = options[:host] @port = options[:port] end
Public Instance Methods
client()
click to toggle source
# File lib/apn/feedback.rb, line 40 def client @client ||= APN::Client.new(host: @host, port: @port, cert: APN.config.cert_file, password: APN.config.cert_password) end
data()
click to toggle source
# File lib/apn/feedback.rb, line 23 def data APN.log(:info, 'Trying to get feedback from Apple push notification server...') @feedback ||= receive end
receive()
click to toggle source
# File lib/apn/feedback.rb, line 29 def receive feedbacks = [] while f = client.feedback feedbacks << f end APN.log(:info, 'Feedback received!') return feedbacks end