Back to Firebase Js Sdk

MessagePayload interface

docs-devsite/messaging_.messagepayload.md

12.12.13.3 KB
Original Source

Project: /docs/reference/js/_project.yaml Book: /docs/reference/_book.yaml page_type: reference

{% comment %} DO NOT EDIT THIS FILE! This is generated by the JS SDK team, and any local changes will be overwritten. Changes should be made in the source code at https://github.com/firebase/firebase-js-sdk {% endcomment %}

MessagePayload interface

Message payload that contains the notification payload that is represented with NotificationPayload and the data payload that contains an arbitrary number of key-value pairs sent by developers through the Send API<!-- -->.

<b>Signature:</b>

typescript
export interface MessagePayload 

Properties

PropertyTypeDescription
collapseKeystringThe collapse key of the message. See Non-collapsible and collapsible messages
data{ [key: string]: string; }Arbitrary key/value payload.
fcmOptionsFcmOptionsOptions for features provided by the FCM SDK for Web. See WebpushFcmOptions<!-- -->.
fromstringThe sender of this message.
messageIdstringThe message ID of a message.
notificationNotificationPayloadDisplay notification details. Details are sent through the Send API<!-- -->.

MessagePayload.collapseKey

The collapse key of the message. See Non-collapsible and collapsible messages

<b>Signature:</b>

typescript
collapseKey: string;

MessagePayload.data

Arbitrary key/value payload.

<b>Signature:</b>

typescript
data?: {
        [key: string]: string;
    };

MessagePayload.fcmOptions

Options for features provided by the FCM SDK for Web. See WebpushFcmOptions<!-- -->.

<b>Signature:</b>

typescript
fcmOptions?: FcmOptions;

MessagePayload.from

The sender of this message.

<b>Signature:</b>

typescript
from: string;

MessagePayload.messageId

The message ID of a message.

<b>Signature:</b>

typescript
messageId: string;

MessagePayload.notification

Display notification details. Details are sent through the Send API<!-- -->.

<b>Signature:</b>

typescript
notification?: NotificationPayload;