Class: RubyPushNotifications::GCM::GCMNotification
- Inherits:
-
Object
- Object
- RubyPushNotifications::GCM::GCMNotification
- Includes:
- NotificationResultsManager
- Defined in:
- lib/ruby-push-notifications/gcm/gcm_notification.rb
Overview
Encapsulates a GCM Notification. By default only Required fields are set. (developer.android.com/google/gcm/server-ref.html#send-downstream)
Instance Attribute Summary
Attributes included from NotificationResultsManager
Instance Method Summary collapse
-
#as_gcm_json ⇒ String
. The GCM’s JSON format for the payload to send. (developer.android.com/google/gcm/server-ref.html#send-downstream).
-
#initialize(registration_ids, data) ⇒ GCMNotification
constructor
Initializes the notification.
Constructor Details
#initialize(registration_ids, data) ⇒ GCMNotification
Initializes the notification
16 17 18 19 |
# File 'lib/ruby-push-notifications/gcm/gcm_notification.rb', line 16 def initialize(registration_ids, data) @registration_ids = registration_ids @data = data end |
Instance Method Details
#as_gcm_json ⇒ String
Returns . The GCM’s JSON format for the payload to send. (developer.android.com/google/gcm/server-ref.html#send-downstream).
23 24 25 26 27 28 |
# File 'lib/ruby-push-notifications/gcm/gcm_notification.rb', line 23 def as_gcm_json JSON.dump( registration_ids: @registration_ids, data: @data ) end |