diff --git a/lib/apnserver.rb b/lib/apnserver.rb index 8731c53..e46be09 100644 --- a/lib/apnserver.rb +++ b/lib/apnserver.rb @@ -2,3 +2,4 @@ require 'apnserver/payload' require 'apnserver/notification' require 'apnserver/client' +require 'apnserver/feedback_client' diff --git a/lib/apnserver/feedback_client.rb b/lib/apnserver/feedback_client.rb new file mode 100644 index 0000000..d8bf251 --- /dev/null +++ b/lib/apnserver/feedback_client.rb @@ -0,0 +1,17 @@ +# Feedback service + +module ApnServer + class FeedbackClient < Client + def initialize(pem, host = 'feedback.push.apple.com', port = 2196, pass = nil) + @pem, @host, @port, @pass = pem, host, port, pass + end + + def read + records ||= [] + while record = @ssl.read(38) + records << record.unpack("NnH*") + end + records + end + end +end \ No newline at end of file