Class: ActsAsPushable::APN::FeedbackService

Inherits:
Object
  • Object
show all
Defined in:
lib/acts_as_pushable/apn/feedback_service.rb

Class Method Summary collapse

Class Method Details

.runObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/acts_as_pushable/apn/feedback_service.rb', line 6

def self.run
  development_apn = Houston::Client.development
  production_apn = Houston::Client.production

  development_apn.certificate = ActsAsPushable.configuration.apn_development_certificate_file
  production_apn.certificate = ActsAsPushable.configuration.apn_production_certificate_file

  devices = development_apn.devices + production_apn.devices

  devices.each do |device|
    device = ActsAsPushable::Device.find_by_token(device.delete(' '))
    device.update_attribute('invalidated_at', Time.current) if device
  end
end