Class: ApnsDispatch::ApnFeedback
- Inherits:
-
Object
- Object
- ApnsDispatch::ApnFeedback
- Defined in:
- lib/apns_dispatch/apn_feedback.rb
Overview
Retrieves and returns failed device tokens from production and development APNs connections.
Constant Summary collapse
- FEEDBACK_PACKET_FORMAT =
Constants
'N1n1H140'
- FEEDBACK_PACKET_LENGTH =
38
Instance Method Summary collapse
- #failed_device_tokens ⇒ Object
-
#initialize(connection) ⇒ ApnFeedback
constructor
A new instance of ApnFeedback.
Constructor Details
#initialize(connection) ⇒ ApnFeedback
Returns a new instance of ApnFeedback.
9 10 11 |
# File 'lib/apns_dispatch/apn_feedback.rb', line 9 def initialize(connection) @connection = connection end |
Instance Method Details
#failed_device_tokens ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/apns_dispatch/apn_feedback.rb', line 13 def failed_device_tokens apns_feedback = [] while line = @connection.read(FEEDBACK_PACKET_LENGTH) apns_feedback << unpackage(line) end apns_feedback end |