コンソールへ移動

Interface representing an FCM legacy API notification message payload. Notification messages let developers send up to 4KB of predefined key-value pairs. Accepted keys are outlined below.

See Build send requests for code samples and detailed documentation.

Indexable

[key: string]: string | undefined

Interface representing an FCM legacy API notification message payload. Notification messages let developers send up to 4KB of predefined key-value pairs. Accepted keys are outlined below.

See Build send requests for code samples and detailed documentation.

Index

Properties

Optional badge

badge: string

The value of the badge on the home screen app icon.

If not specified, the badge is not changed.

If set to 0, the badge is removed.

Platforms: iOS

Optional body

body: string

The notification's body text.

Platforms: iOS, Android, Web

Optional bodyLocArgs

bodyLocArgs: string

Variable string values to be used in place of the format specifiers in body_loc_key to use to localize the body text to the user's current localization.

The value should be a stringified JSON array.

iOS: Corresponds to loc-args in the APNs payload. See Payload Key Reference and Localizing the Content of Your Remote Notifications for more information.

Android: See Formatting and Styling for more information.

Platforms: iOS, Android

Optional bodyLocKey

bodyLocKey: string

The key to the body string in the app's string resources to use to localize the body text to the user's current localization.

iOS: Corresponds to loc-key in the APNs payload. See Payload Key Reference and Localizing the Content of Your Remote Notifications for more information.

Android: See String Resources * for more information.

Platforms: iOS, Android

Optional clickAction

clickAction: string

Action associated with a user click on the notification. If specified, an activity with a matching Intent Filter is launched when a user clicks on the notification.

  • Platforms: Android

Optional color

color: string

The notification icon's color, expressed in #rrggbb format.

Platforms: Android

Optional icon

icon: string