Class: AppleShove::APNS::FeedbackConnection
- Inherits:
-
Connection
- Object
- Connection
- AppleShove::APNS::FeedbackConnection
- Defined in:
- lib/apple_shove/apns/feedback_connection.rb
Instance Attribute Summary
Attributes inherited from Connection
Instance Method Summary collapse
- #device_tokens ⇒ Object
-
#initialize(p12, sandbox) ⇒ FeedbackConnection
constructor
A new instance of FeedbackConnection.
Methods inherited from Connection
#disconnect, #reconnect, #safe_last_used, #socket
Constructor Details
#initialize(p12, sandbox) ⇒ FeedbackConnection
Returns a new instance of FeedbackConnection.
5 6 7 8 9 |
# File 'lib/apple_shove/apns/feedback_connection.rb', line 5 def initialize(p12, sandbox) host = "feedback.#{sandbox ? 'sandbox.' : ''}push.apple.com" super host, 2196, p12 end |
Instance Method Details
#device_tokens ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/apple_shove/apns/feedback_connection.rb', line 11 def device_tokens tokens = [] while response = socket.read(38) , token_length, device_token = response.unpack('N1n1H*') tokens << device_token end tokens end |