Class: Firebase::Admin::Messaging::Message
- Inherits:
-
Object
- Object
- Firebase::Admin::Messaging::Message
- Defined in:
- lib/firebase/admin/messaging/message.rb
Overview
A message that can be sent via Firebase Cloud Messaging.
Contains payload information as well as recipient information. In particular, the message must contain exactly one of token, topic or condition fields.
Instance Attribute Summary collapse
-
#android ⇒ AndroidConfig?
An AndroidConfig (optional).
-
#apns ⇒ APNSConfig?
An APNSConfig (optional).
-
#condition ⇒ String?
The FCM condition to which the message should be sent (optional).
-
#data ⇒ Hash<String, String>?
A hash of data fields (optional).
-
#fcm_options ⇒ FCMOptions?
An FCMOptions (optional).
-
#notification ⇒ Notification?
A Notification (optional).
-
#token ⇒ String?
Registration token of the device to which the message should be sent (optional).
-
#topic ⇒ String?
Name of the FCM topic to which the message should be sent (optional).
Instance Method Summary collapse
-
#initialize(data: nil, notification: nil, android: nil, apns: nil, fcm_options: nil, token: nil, topic: nil, condition: nil) ⇒ Message
constructor
Initializes a Message.
Constructor Details
#initialize(data: nil, notification: nil, android: nil, apns: nil, fcm_options: nil, token: nil, topic: nil, condition: nil) ⇒ Message
Initializes a Firebase::Admin::Messaging::Message.
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/firebase/admin/messaging/message.rb', line 61 def initialize( data: nil, notification: nil, android: nil, apns: nil, fcm_options: nil, token: nil, topic: nil, condition: nil ) self.data = data self.notification = notification self.android = android self.apns = apns self. = self.token = token self.topic = topic self.condition = condition end |
Instance Attribute Details
#android ⇒ AndroidConfig?
Returns An AndroidConfig (optional).
19 20 21 |
# File 'lib/firebase/admin/messaging/message.rb', line 19 def android @android end |
#apns ⇒ APNSConfig?
Returns An APNSConfig (optional).
23 24 25 |
# File 'lib/firebase/admin/messaging/message.rb', line 23 def apns @apns end |
#condition ⇒ String?
Returns The FCM condition to which the message should be sent (optional).
40 41 42 |
# File 'lib/firebase/admin/messaging/message.rb', line 40 def condition @condition end |
#data ⇒ Hash<String, String>?
Returns A hash of data fields (optional). All keys and values must be strings.
11 12 13 |
# File 'lib/firebase/admin/messaging/message.rb', line 11 def data @data end |
#fcm_options ⇒ FCMOptions?
Returns An FCMOptions (optional).
27 28 29 |
# File 'lib/firebase/admin/messaging/message.rb', line 27 def @fcm_options end |
#notification ⇒ Notification?
Returns A Notification (optional).
15 16 17 |
# File 'lib/firebase/admin/messaging/message.rb', line 15 def notification @notification end |
#token ⇒ String?
Returns Registration token of the device to which the message should be sent (optional).
31 32 33 |
# File 'lib/firebase/admin/messaging/message.rb', line 31 def token @token end |
#topic ⇒ String?
Returns Name of the FCM topic to which the message should be sent (optional). Topic name may contain the ‘/topics/` prefix.
36 37 38 |
# File 'lib/firebase/admin/messaging/message.rb', line 36 def topic @topic end |