Module: MultitenantPush::APNS
- Defined in:
- lib/multitenant_push/apns.rb
Class Method Summary collapse
- .feedback ⇒ Object
- .load_credentials ⇒ Object
- .method_missing(method, *args, &block) ⇒ Object
- .methods ⇒ Object
- .send_notification(device_token, message) ⇒ Object
- .send_notifications(notifications) ⇒ Object
Class Method Details
.feedback ⇒ Object
17 18 19 20 |
# File 'lib/multitenant_push/apns.rb', line 17 def self.feedback self.load_credentials() APNS2.feedback end |
.load_credentials ⇒ Object
31 32 33 34 35 36 37 38 39 40 |
# File 'lib/multitenant_push/apns.rb', line 31 def self.load_credentials raise NoTenantCredentials if Tenant.current_tenant.nil? credentials = Credential.first raise NoTenant if credentials.nil? || credentials.apns_host.blank? || credentials.apns_pass.blank? APNS.host = credentials.apns_host APNS.pass = credentials.apns_pass APNS.pem = "lib/#{Tenant.current_tenant.name}.pem" end |
.method_missing(method, *args, &block) ⇒ Object
26 27 28 |
# File 'lib/multitenant_push/apns.rb', line 26 def self.method_missing(method, *args, &block) APNS2.send method, *args end |
.methods ⇒ Object
22 23 24 |
# File 'lib/multitenant_push/apns.rb', line 22 def self.methods APNS2.methods end |
.send_notification(device_token, message) ⇒ Object
7 8 9 10 |
# File 'lib/multitenant_push/apns.rb', line 7 def self.send_notification(device_token, ) self.load_credentials() APNS2.send_notification(device_token, ) end |
.send_notifications(notifications) ⇒ Object
12 13 14 15 |
# File 'lib/multitenant_push/apns.rb', line 12 def self.send_notifications(notifications) self.load_credentials() APNS2.send_notification(device_token, ) end |