module MultitenantPush::GCM

Public Class Methods

load_credentials() click to toggle source
# File lib/multitenant_push/gcm.rb, line 22
def self.load_credentials
  raise NoTenant if Tenant.current_tenant.nil?
  credentials = Credential.first
  raise NoTenantCredentials if credentials.nil? || credentials.gcm_host.blank? || credentials.gcm_key.blank?

  GCM.host = credentials.gcm_host
  GCM.key = credentials.gcm_key

end
method_missing(method, *args, &block) click to toggle source
# File lib/multitenant_push/gcm.rb, line 17
def self.method_missing(method, *args, &block)
  GCM2.send method, *args
end
methods() click to toggle source
# File lib/multitenant_push/gcm.rb, line 13
def self.methods
  GCM2.methods
end
send_notification( device_tokens, data) click to toggle source
# File lib/multitenant_push/gcm.rb, line 8
def self.send_notification( device_tokens, data)
  self.load_credentials()
  GCM2.send_notification( device_tokens, data)
end