RemoteMessage

@SafeParcelable.Reserved(value = [1])
@SafeParcelable.Class(creator = "RemoteMessageCreator")
class RemoteMessage : AbstractSafeParcelable


A remote Firebase Message.

Messages will be received via onMessageReceived.

Messages may have a Notification instance if they are received while the application is in the foreground, otherwise they will be automatically posted to the notification tray.

Summary

Nested types

Builder object for constructing RemoteMessage instances.

@IntDef(value = )
@Retention(value = RetentionPolicy.SOURCE)
annotation RemoteMessage.MessagePriority

Priority of the message

Remote Firebase notification details.

Constants

const Int
const Int
const Int

Public functions

String?

Gets the collapse key of the message.

String?

Get the sender of this message.

String?

Gets the message's ID.

String?

Gets the type of message.

Int

Gets the original priority of message.

Int

Gets the priority of message as delivered.

String?

Gets the Sender ID for the sender of this message.

Long

Gets the time in milliseconds from the Epoch that the message was sent.

String?

This function is deprecated.

This function is actually decommissioned along with all of FCM upstream messaging.

Int

Gets the message time to live (TTL) in seconds.

Unit
writeToParcel(out: Parcel, flags: Int)

Constants

PRIORITY_HIGH

const val PRIORITY_HIGH = 1: Int

PRIORITY_NORMAL

const val PRIORITY_NORMAL = 2: Int

PRIORITY_UNKNOWN

const val PRIORITY_UNKNOWN = 0: Int

Public functions

getCollapseKey

fun getCollapseKey(): String?

Gets the collapse key of the message.

Returns
String?

The collapse key

getFrom

fun getFrom(): String?

Get the sender of this message.

This will be the sender ID or the topic for topic messages.

Returns
String?

The message sender

getMessageId

fun getMessageId(): String?

Gets the message's ID.

This is automatically generated by the server. Treat it as an opaque string. Do not rely on its format to be consistent.

Returns
String?

The message ID

getMessageType

fun getMessageType(): String?

Gets the type of message.

Returns
String?

The message type

getOriginalPriority

@RemoteMessage.MessagePriority
fun getOriginalPriority(): Int

Gets the original priority of message.

Returns
Int

The original message priority

getPriority

@RemoteMessage.MessagePriority
fun getPriority(): Int

Gets the priority of message as delivered. This may be lower than the priority originally requested.

Returns
Int

The message priority as delivered

getSenderId

fun getSenderId(): String?

Gets the Sender ID for the sender of this message.

Returns
String?

the message Sender ID

getSentTime

fun getSentTime(): Long

Gets the time in milliseconds from the Epoch that the message was sent.

Returns
Long

The time that the message was sent

getTo

fun getTo(): String?

Gets the message destination.

getTtl

fun getTtl(): Int

Gets the message time to live (TTL) in seconds.

Returns
Int

The message TTL

writeToParcel

fun writeToParcel(out: Parcel, flags: Int): Unit

Public properties

data

val data: (Mutable)Map<String!, String!>!