Class: TinyAPNS::Feedback
- Inherits:
-
Object
- Object
- TinyAPNS::Feedback
- Defined in:
- lib/tiny_apns.rb
Instance Method Summary collapse
Instance Method Details
#devices(conn, &block) ⇒ Object
47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/tiny_apns.rb', line 47 def devices(conn, &block) devices = [] conn.open_for_feedback do |ssl| while line = ssl.read(38) # Read 38 bytes from the SSL socket feedback = line.unpack('N1n1H140') token = feedback[2].scan(/.{0,8}/).join('').strip devices << {:token=>token, :feedback=>feedback[0]} yield(token, feedback[0]) if block_given? end end return devices end |