Module: FwtPushNotificationServer

Defined in:
lib/notifier/gcm.rb,
lib/notifier/apns.rb,
lib/notifier/base.rb,
lib/fwt_push_notification_server.rb,
lib/fwt_push_notification_server/engine.rb,
lib/fwt_push_notification_server/version.rb,
app/models/fwt_push_notification_server/device_token.rb,
app/helpers/fwt_push_notification_server/device_tokens_helper.rb,
app/controllers/fwt_push_notification_server/device_tokens_controller.rb,
lib/generators/fwt_push_notification_server/install/install_generator.rb

Defined Under Namespace

Modules: DeviceTokensHelper, Generators, Notifier Classes: DeviceToken, DeviceTokensController, Engine

Constant Summary collapse

VERSION =
"0.0.7"
@@authentication_filter =
:authenticate_user!
@@user_key =
:user_id
@@apns_gateway =
'sandbox.push.apple.com'
@@notifiers =
{
  :apns => Notifier::APNS.new,
  :gcm => Notifier::GCM.new
}

Class Method Summary collapse

Class Method Details

.apns_configObject



42
43
44
45
46
47
48
# File 'lib/fwt_push_notification_server.rb', line 42

def self.apns_config
  {
    :gateway => apns_gateway,
    :certificate => apns_certificate,
    :passphrase => apns_passphrase
  }
end

.begin_transaction(message) ⇒ Object



50
51
52
53
54
# File 'lib/fwt_push_notification_server.rb', line 50

def self.begin_transaction(message)
  notifiers.each_value do |notifier|
    notifier.begin_transaction(message)
  end
end

.commit_transactionObject



56
57
58
59
60
# File 'lib/fwt_push_notification_server.rb', line 56

def self.commit_transaction
  notifiers.each_value do |notifier|
    notifier.commit_transaction
  end
end

.configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



28
29
30
# File 'lib/fwt_push_notification_server.rb', line 28

def self.configure
  yield self
end