Class: NotifyUser::Apns

Inherits:
Push
  • Object
show all
Defined in:
app/models/notify_user/apns.rb

Constant Summary collapse

NO_ERROR =
-42
INVALID_TOKEN_ERROR =
8

Constants inherited from Push

Push::PAYLOAD_LIMIT, Push::SYMBOL_NAMES_SIZE

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(notifications, devices, options) ⇒ Apns

Returns a new instance of Apns.



11
12
13
14
15
16
# File 'app/models/notify_user/apns.rb', line 11

def initialize(notifications, devices, options)
  super(notifications, devices, options)

  @push_options = setup_options
  @devices = devices
end

Instance Attribute Details

#apn_connectionObject

Returns the value of attribute apn_connection.



9
10
11
# File 'app/models/notify_user/apns.rb', line 9

def apn_connection
  @apn_connection
end

#push_optionsObject

Returns the value of attribute push_options.



9
10
11
# File 'app/models/notify_user/apns.rb', line 9

def push_options
  @push_options
end

Instance Method Details

#pushObject



18
19
20
21
22
23
# File 'app/models/notify_user/apns.rb', line 18

def push
  APNConnection::POOL.with do |apn_conn|
    @apn_connection = apn_conn
    send_notifications
  end
end