Go to console

Interface representing the options that can be provided when sending a message via the FCM legacy APIs.

See Build send requests for code samples and detailed documentation.

Indexable

[key: string]: any | undefined

Interface representing the options that can be provided when sending a message via the FCM legacy APIs.

See Build send requests for code samples and detailed documentation.

Index

Properties

Optional collapseKey

collapseKey: string

String identifying a group of messages (for example, "Updates Available") that can be collapsed, so that only the last message gets sent when delivery can be resumed. This is used to avoid sending too many of the same messages when the device comes back online or becomes active.

There is no guarantee of the order in which messages get sent.

A maximum of four different collapse keys is allowed at any given time. This means FCM server can simultaneously store four different send-to-sync messages per client app. If you exceed this number, there is no guarantee which four collapse keys the FCM server will keep.

Default value: None

Optional contentAvailable

contentAvailable: boolean

On iOS, use this field to represent content-available in the APNs payload. When a notification or data message is sent and this is set to true, an inactive client app is awoken. On Android, data messages wake the app by default. On Chrome, this flag is currently not supported.

Default value: false

Optional dryRun

dryRun: boolean

Whether or not the message should actually be sent. When set to true, allows developers to test a request without actually sending a message. When set to false, the message will be sent.

Default value: false

Optional mutableContent

mutableContent: boolean

On iOS, use this field to represent mutable-content in the APNs payload. When a notification is sent and this is set to true, the content of the notification can be modified before it is displayed, using a Notification Service app extension

On Android and Web, this parameter will be ignored.

Default value: false

Optional priority

priority: string

The priority of the message. Valid values are "normal" and "high". On iOS, these correspond to APNs priorities 5 and 10.

By default, notification messages are sent with high priority, and data messages are sent with normal priority. Normal priority optimizes the client app's battery consumption and should be used unless immediate delivery is required. For messages with normal priority, the app may receive the message with unspecified delay.

When a message is sent with high priority, it is sent immediately, and the app can wake a sleeping device and open a network connection to your server.

For more information, see Setting the priority of a message.

Default value: "high" for notification messages, "normal" for data messages

Op