Class: RubyPushNotifications::MPNS::MPNSInvalidError

Inherits:
MPNSResult
  • Object
show all
Defined in:
lib/ruby-push-notifications/mpns/mpns_result.rb

Overview

The subscription is invalid and is not present on the Push Notification Service.

Constant Summary

Constants inherited from MPNSResult

RubyPushNotifications::MPNS::MPNSResult::X_DEVICE_CONNECTION_STATUS, RubyPushNotifications::MPNS::MPNSResult::X_NOTIFICATION_STATUS, RubyPushNotifications::MPNS::MPNSResult::X_SUBSCRIPTION_STATUS

Instance Attribute Summary collapse

Attributes inherited from MPNSResult

#device_url

Instance Method Summary collapse

Constructor Details

#initialize(device_url, headers) ⇒ MPNSInvalidError

Returns a new instance of MPNSInvalidError.



88
89
90
91
92
93
# File 'lib/ruby-push-notifications/mpns/mpns_result.rb', line 88

def initialize(device_url, headers)
  @device_url = device_url
  @notification_status = headers[X_NOTIFICATION_STATUS]
  @device_connection_status = headers[X_DEVICE_CONNECTION_STATUS]
  @subscription_status = headers[X_SUBSCRIPTION_STATUS]
end

Instance Attribute Details

#device_connection_statusString

Returns . The connection status of the device.

Returns:

  • (String)

    . The connection status of the device.



83
84
85
# File 'lib/ruby-push-notifications/mpns/mpns_result.rb', line 83

def device_connection_status
  @device_connection_status
end

#notification_statusString

by the Microsoft Push Notification Service.

Returns:

  • (String)

    . The status of the notification received



80
81
82
# File 'lib/ruby-push-notifications/mpns/mpns_result.rb', line 80

def notification_status
  @notification_status
end

#subscription_statusString

Returns . The subscription status.

Returns:

  • (String)

    . The subscription status.



86
87
88
# File 'lib/ruby-push-notifications/mpns/mpns_result.rb', line 86

def subscription_status
  @subscription_status
end

Instance Method Details

#==(other) ⇒ Object



95
96
97
98
99
100
101
# File 'lib/ruby-push-notifications/mpns/mpns_result.rb', line 95

def ==(other)
  (other.is_a?(MPNSInvalidError) &&
    device_url == other.device_url &&
    notification_status == other.notification_status &&
    device_connection_status == other.device_connection_status &&
    subscription_status == other.subscription_status) || super(other)
end