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.8.7'.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) ⇒ Object
Send ios notification with the configuration of BMO (see #BMO::Configuration).
Class Method Details
.configuration ⇒ Object
51 52 53 |
# File 'lib/bmo/configuration.rb', line 51 def self.configuration @configuration ||= Configuration.new end |
.configuration=(configuration) ⇒ Object
Help ? rubocop:disable TrivialAccessors
57 58 59 |
# File 'lib/bmo/configuration.rb', line 57 def self.configuration=(configuration) @configuration = configuration end |
.configure {|configuration| ... } ⇒ Object
class Configuration
46 47 48 49 |
# File 'lib/bmo/configuration.rb', line 46 def self.configure yield(configuration) if block_given? configuration end |
.ios_feedback ⇒ Array<FeedbackTuple>
Get the iOS Feedback tuples
44 45 46 |
# File 'lib/bmo.rb', line 44 def self.ios_feedback apns_client.feedback end |
.reset_configuration ⇒ Object
rubocop:enable
62 63 64 |
# File 'lib/bmo/configuration.rb', line 62 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)
57 58 59 60 61 |
# File 'lib/bmo.rb', line 57 def self.send_android_notification(device_token, data) notification = GCM::Notification.new(device_token, data) notification.validate! gcm_client.send_notification(notification) end |
.send_ios_notification(device_token, data) ⇒ Object
Send ios notification with the configuration of BMO
(see #BMO::Configuration)
34 35 36 37 38 |
# File 'lib/bmo.rb', line 34 def self.send_ios_notification(device_token, data) notification = APNS::Notification.new(device_token, data) notification.validate! apns_client.send_notification(notification) end |