MessagePayload interface
Stay organized with collections
Save and categorize content based on your preferences.
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.
Signature:
export interface MessagePayload
Properties
MessagePayload.collapseKey
The collapse key of the message. See Non-collapsible and collapsible messages
Signature:
collapseKey: string;
MessagePayload.data
Arbitrary key/value payload.
Signature:
data?: {
[key: string]: string;
};
MessagePayload.fcmOptions
Options for features provided by the FCM SDK for Web. See WebpushFcmOptions.
Signature:
fcmOptions?: FcmOptions;
MessagePayload.from
The sender of this message.
Signature:
from: string;
MessagePayload.messageId
The message ID of a message.
Signature:
messageId: string;
MessagePayload.notification
Display notification details. Details are sent through the Send API.
Signature:
notification?: NotificationPayload;
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-07-20 UTC.
[null,null,["Last updated 2023-07-20 UTC."],[],[],null,["Message payload that contains the notification payload that is represented with [NotificationPayload](./messaging_.notificationpayload.md#notificationpayload_interface) and the data payload that contains an arbitrary number of key-value pairs sent by developers through the [Send API](https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#notification).\n\n**Signature:** \n\n export interface MessagePayload \n\nProperties\n\nMessagePayload.collapseKey\n\nThe collapse key of the message. See [Non-collapsible and collapsible messages](https://firebase.google.com/docs/cloud-messaging/concept-options#collapsible_and_non-collapsible_messages)\n\n**Signature:** \n\n collapseKey: string;\n\nMessagePayload.data\n\nArbitrary key/value payload.\n\n**Signature:** \n\n data?: {\n [key: string]: string;\n };\n\nMessagePayload.fcmOptions\n\nOptions for features provided by the FCM SDK for Web. See [WebpushFcmOptions](https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#webpushfcmoptions).\n\n**Signature:** \n\n fcmOptions?: FcmOptions;\n\nMessagePayload.from\n\nThe sender of this message.\n\n**Signature:** \n\n from: string;\n\nMessagePayload.messageId\n\nThe message ID of a message.\n\n**Signature:** \n\n messageId: string;\n\nMessagePayload.notification\n\nDisplay notification details. Details are sent through the [Send API](https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#notification).\n\n**Signature:** \n\n notification?: NotificationPayload;"]]