class Firebase::Admin::Messaging::Message
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.
Attributes
android[RW]
@return [AndroidConfig, nil]
An {AndroidConfig} (optional).
apns[RW]
@return [APNSConfig, nil]
An {APNSConfig} (optional).
condition[RW]
@return [String, nil]
The FCM condition to which the message should be sent (optional).
data[RW]
@return [Hash<String, String>, nil]
A hash of data fields (optional). All keys and values must be strings.
fcm_options[RW]
@return [FCMOptions, nil]
An {FCMOptions} (optional).
notification[RW]
@return [Notification, nil]
A {Notification} (optional).
token[RW]
@return [String, nil]
Registration token of the device to which the message should be sent (optional).
topic[RW]
@return [String, nil]
Name of the FCM topic to which the message should be sent (optional). Topic name may contain the `/topics/` prefix.
Public Class Methods
new( data: nil, notification: nil, android: nil, apns: nil, fcm_options: nil, token: nil, topic: nil, condition: nil )
click to toggle source
Initializes a {Message}.
@param [Hash<String, String>, nil] data
A hash of data fields (optional). All keys and values must be strings.
@param [Notification, nil] notification
A {Notification} (optional).
@param [AndroidConfig, nil] android
An {AndroidConfig} (optional).
@param [APNSConfig, nil] apns
An {APNSConfig} (optional).
@param [FCMOptions, nil] fcm_options
An {FCMOptions} (optional).
@param [String, nil] token
A registration token of the device to send the message to (optional).
@param [String, nil] topic
The name of the FCM topic to send the message to (optional). The topic name may contain the `/topics/` prefix.
@param [String, nil] condition
The FCM condition to which the message should be sent (optional).
# 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.fcm_options = fcm_options self.token = token self.topic = topic self.condition = condition end