Class: APNS::NotificationResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/apns/notification_response.rb

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ NotificationResponse

Returns a new instance of NotificationResponse.



4
5
6
# File 'lib/apns/notification_response.rb', line 4

def initialize(response)
  @response = response
end

Instance Method Details

#device_unsubscribed?Boolean

Returns:

  • (Boolean)


12
13
14
15
16
17
# File 'lib/apns/notification_response.rb', line 12

def device_unsubscribed?
  @response.validation_error? &&
  @response.body['errors'] &&
  @response.body['errors']['device'] &&
  @response.body['errors']['device'].include?('unsubscribed')
end

#success?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/apns/notification_response.rb', line 8

def success?
  @response.success?
end