admin.messaging. NotificationMessagePayload
Interface representing a notification message payload. Notification messages let developers send up to 2KB of predefined key-value pairs. Accepted keys are outlined below.
See Defining the message payload for code samples and detailed documentation.
Properties
badge
string
The badge on the client app home icon.
Platforms: iOS
body
string
The notification body text.
Platforms: iOS, Android, Web
bodyLocArgs
string
The string value to replace format specifiers in the body string for localization.
The value should be a stringified JSON array.
iOS: Corresponds to loc-args in the APNs payload.
Android: For more information, see Formatting and Styling.
Platforms: iOS, Android
bodyLocKey
string
The key to the body string for localization.
iOS: Corresponds to loc-key in the APNs payload.
Android: Use the key in the app's string resources when populating this value.
Platforms: iOS, Android
clickAction
string
The action associated with a user click on the notification.
iOS: Corresponds to category in the APNs payload.
Android: When this is set, an activity with a matching intent filter is launched when user clicks the notification.
Web: For all URL values, secure HTTPS is required.
Platforms: iOS, Android, Web
color
string
The color of the icon, expressed in #rrggbb format.
icon
string
The notification icon.
Android: Sets value to myicon for drawable resource myicon. If you don't send this key in the request, FCM displays the launcher icon specified in your app manifest.
Web: The URL for a notification icon.
Platforms: Android, Web
sound
string
The sound to play when the device receives a notification.
iOS: Sound files can be in the main bundle of the client app or in the Library/Sounds folder of the app's data container. See the iOS Developer Library for more information.
Android: Supports "default" or the filename of a sound resource bundled in the app. Sound files must reside in /res/raw/.
Platforms: iOS, Android
tag
string
String used to indicate whether each notification results in a new entry in the notification drawer on Android. If not set, each request creates a new notification. If set, and a notification with the same tag is already being shown, the new notification replaces the existing one in the notification drawer.
Platforms: Android
title
string
The notification title.
Platforms: iOS, Android, Web
titleLocArgs
string
Indicates the string value to replace format specifiers in the title string for localization.
The value should be a stringified JSON array.
iOS: Corresponds to title-loc-args in the APNs payload.
Android: For more information, see Formatting strings.
Platforms: iOS, Android
titleLocKey
string
The key to the title string for localization.
iOS: Corresponds to title-loc-key in the APNs payload.
Android: Use the key in the app's string resources when populating this value.
Platforms: iOS, Android

