Module: BMO
- Defined in:
- lib/bmo.rb,
lib/bmo/utils.rb,
lib/bmo/version.rb,
lib/bmo/gcm/client.rb,
lib/bmo/apns/client.rb,
lib/bmo/configuration.rb,
lib/bmo/gcm/connection.rb,
lib/bmo/apns/connection.rb,
lib/bmo/gcm/notification.rb,
lib/bmo/apns/notification.rb
Overview
Main BMO module
Defined Under Namespace
Modules: APNS, GCM, Utils Classes: Configuration
Constant Summary collapse
- VERSION =
'0.11.2'.freeze
Class Method Summary collapse
- .configuration ⇒ Object
-
.configuration=(configuration) ⇒ Object
Help ? rubocop:disable TrivialAccessors.
-
.configure {|configuration| ... } ⇒ Object
class Configuration.
-
.ios_feedback ⇒ Array<FeedbackTuple>
Get the iOS Feedback tuples.
-
.reset_configuration ⇒ Object
rubocop:enable.
-
.send_android_notification(device_token, data) ⇒ Faraday::Response
Send android notification with the configuration of BMO (see #BMO::Configuration).
-
.send_ios_notification(device_token, data, options = {}) ⇒ Object
Send ios notification with the configuration of BMO (see #BMO::Configuration).
Class Method Details
.configuration ⇒ Object
50 51 52 |
# File 'lib/bmo/configuration.rb', line 50 def self.configuration @configuration ||= Configuration.new end |
.configuration=(configuration) ⇒ Object
Help ? rubocop:disable TrivialAccessors
56 57 58 |
# File 'lib/bmo/configuration.rb', line 56 def self.configuration=(configuration) @configuration = configuration end |
.configure {|configuration| ... } ⇒ Object
class Configuration
45 46 47 48 |
# File 'lib/bmo/configuration.rb', line 45 def self.configure yield(configuration) if block_given? configuration end |
.ios_feedback ⇒ Array<FeedbackTuple>
Get the iOS Feedback tuples
46 47 48 |
# File 'lib/bmo.rb', line 46 def self.ios_feedback apns_client.feedback end |
.reset_configuration ⇒ Object
rubocop:enable
61 62 63 |
# File 'lib/bmo/configuration.rb', line 61 def self.reset_configuration @configuration = Configuration.new end |
.send_android_notification(device_token, data) ⇒ Faraday::Response
Send android notification with the configuration of BMO
(see #BMO::Configuration)
59 60 61 62 63 |
# File 'lib/bmo.rb', line 59 def self.send_android_notification(device_token, data) data = Utils.coerce_to_symbols(data) notification = GCM::Notification.new(device_token, data) gcm_client.send_notification(notification) end |
.send_ios_notification(device_token, data, options = {}) ⇒ Object
Send ios notification with the configuration of BMO
(see #BMO::Configuration)
36 37 38 39 40 |
# File 'lib/bmo.rb', line 36 def self.send_ios_notification(device_token, data, = {}) data = Utils.coerce_to_symbols(data) notification = APNS::Notification.new(device_token, data, ) apns_client.send_notification(notification) end |