lib/pushmeup/apns/gateway.rb
def feedback
      fhost         = HOST.gsub('gateway','feedback')
      fsock         = TCPSocket.new(fhost, 2196)
      fssl          = OpenSSL::SSL::SSLSocket.new(fsock, context)
      fssl.connect

      apns_feedback = []

      while line = fssl.read(38)   # Read lines from the socket
        line.strip!
        f = line.unpack('N1n1H140')
        apns_feedback << { :timestamp => Time.at(f[0]), :token => f[2] }
      end

      fssl.close
      fsock.close

      apns_feedback
    end
# You should connect regularly with the feedback service and fetch the current list of those
# devices that have repeatedly reported failed-delivery attempts. Then stop sending
# notifications to the devices associated with those apps. See The Feedback Service for
# more information. https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/CommunicatingWIthAPS.html#//apple_ref/doc/uid/TP40008194-CH101-SW3
You should connect regularly with the feedback service and fetch the current list of those
devices that have repeatedly reported failed-delivery attempts. Then stop sending
notifications to the devices associated with those apps. See The Feedback Service for
more information.
You should connect regularly with the feedback service and fetch the current list of those devices that have repeatedly reported failed - delivery attempts . Then stop sending notifications to the devices associated with those apps . See The Feedback Service for more information .
def feedback
      fhost         = HOST.gsub('gateway','feedback')
      fsock         = TCPSocket.new(fhost, 2196)
      fssl          = OpenSSL::SSL::SSLSocket.new(fsock, context)
      fssl.connect
      apns_feedback = []
      while line = fssl.read(38)   
        line.strip!
        f = line.unpack('N1n1H140')
        apns_feedback << { :timestamp => Time.at(f[0]), :token => f[2] }
      end
      fssl.close
      fsock.close
      apns_feedback
    end
def feedback fhost = HOST . gsub ( 'gateway' , 'feedback' ) fsock = TCPSocket . new ( fhost , 2196 ) fssl = OpenSSL :: SSL :: SSLSocket . new ( fsock , context ) fssl . connect apns_feedback = [ ] while line = fssl . read ( 38 ) line . strip! f = line . unpack ( 'N1n1H140' ) apns_feedback << { :timestamp => Time . at ( f [ 0 ] ) , :token => f [ 2 ] } end fssl . close fsock . close apns_feedback end
You should connect regularly with the feedback service and fetch the current list of those
devices that have repeatedly reported failed-delivery attempts.
You should connect regularly with the feedback service and fetch the current list of those devices that have repeatedly reported failed - delivery attempts .
# Read lines from the socket