AndroidNotification interface

Represents the Android-specific notification options that can be included inAndroidConfig.

Signature:

exportinterfaceAndroidNotification

Properties

PropertyTypeDescription
bodystringBody of the Android notification. When provided, overrides the body set viaadmin.messaging.Notification.
bodyLocArgsstring[]An array of resource keys that will be used in place of the format specifiers inbodyLocKey.
bodyLocKeystringKey of the body string in the app's string resource to use to localize the body text.
channelIdstringThe Android notification channel ID (new in Android O). The app must create a channel with this channel ID before any notification with this channel ID can be received. If you don't send this channel ID in the request, or if the channel ID provided has not yet been created by the app, FCM uses the channel ID specified in the app manifest.
clickActionstringAction 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.
colorstringNotification icon color in#rrggbb format.
defaultLightSettingsbooleanIf set totrue, use the Android framework's default LED light settings for the notification. Default values are specified inconfig.xml. Ifdefault_light_settings is set totrue andlight_settings is also set, the user-specifiedlight_settings is used instead of the default value.
defaultSoundbooleanIf set totrue, use the Android framework's default sound for the notification. Default values are specified inconfig.xml.
defaultVibrateTimingsbooleanIf set totrue, use the Android framework's default vibrate pattern for the notification. Default values are specified inconfig.xml. IfdefaultVibrateTimings is set totrue andvibrateTimingsMillis is also set, the default value is used instead of the user-specifiedvibrateTimingsMillis.
eventTimestampDateFor notifications that inform users about events with an absolute time reference, sets the time that the event in the notification occurred. Notifications in the panel are sorted by this time.
iconstringIcon resource for the Android notification.
imageUrlstringURL of an image to be displayed in the notification.
lightSettingsLightSettingsSettings to control the notification's LED blinking rate and color if LED is available on the device. The total blinking time is controlled by the OS.
localOnlybooleanSets whether or not this notification is relevant only to the current device. Some notifications can be bridged to other devices for remote display, such as a Wear OS watch. This hint can be set to recommend this notification not be bridged. SeeWear OS guides.
notificationCountnumberSets the number of items this notification represents. May be displayed as a badge count for Launchers that support badging. SeeNotificationBadge. For example, this might be useful if you're using just one notification to represent multiple new messages but you want the count here to represent the number of total new messages. If zero or unspecified, systems that support badging use the default, which is to increment a number displayed on the long-press menu each time a new notification arrives.
priority('min' | 'low' | 'default' | 'high' | 'max')Sets the relative priority for this notification. Low-priority notifications may be hidden from the user in certain situations. Note this priority differs fromAndroidMessagePriority. This priority is processed by the client after the message has been delivered. WhereasAndroidMessagePriority is an FCM concept that controls when the message is delivered.
proxy('allow' | 'deny' | 'if_priority_lowered')Sets if this notification should attempt to be proxied. Must be eitherallow,deny orif_priority_lowered. If unspecified, it remains undefined in the Admin SDK, and defers to the FCM backend's default mapping.
soundstringFile name of the sound to be played when the device receives the notification.
stickybooleanWhen set tofalse or unset, the notification is automatically dismissed when the user clicks it in the panel. When set totrue, the notification persists even when the user clicks it.
tagstringNotification tag. This is an identifier used to replace existing notifications in the notification drawer. If not specified, each request creates a new notification.
tickerstringSets the "ticker" text, which is sent to accessibility services. Prior to API level 21 (Lollipop), sets the text that is displayed in the status bar when the notification first arrives.
titlestringTitle of the Android notification. When provided, overrides the title set viaadmin.messaging.Notification.
titleLocArgsstring[]An array of resource keys that will be used in place of the format specifiers intitleLocKey.
titleLocKeystringKey of the title string in the app's string resource to use to localize the title text.
vibrateTimingsMillisnumber[]Sets the vibration pattern to use. Pass in an array of milliseconds to turn the vibrator on or off. The first value indicates the duration to wait before turning the vibrator on. The next value indicates the duration to keep the vibrator on. Subsequent values alternate between duration to turn the vibrator off and to turn the vibrator on. IfvibrateTimingsMillis is set anddefaultVibrateTimings is set totrue, the default value is used instead of the user-specifiedvibrateTimingsMillis.
visibility('private' | 'public' | 'secret')Sets the visibility of the notification. Must be eitherprivate,public, orsecret. If unspecified, it remains undefined in the Admin SDK, and defers to the FCM backend's default mapping.

AndroidNotification.body

Body of the Android notification. When provided, overrides the body set viaadmin.messaging.Notification.

Signature:

body?:string;

AndroidNotification.bodyLocArgs

An array of resource keys that will be used in place of the format specifiers inbodyLocKey.

Signature:

bodyLocArgs?:string[];

AndroidNotification.bodyLocKey

Key of the body string in the app's string resource to use to localize the body text.

Signature:

bodyLocKey?:string;

AndroidNotification.channelId

The Android notification channel ID (new in Android O). The app must create a channel with this channel ID before any notification with this channel ID can be received. If you don't send this channel ID in the request, or if the channel ID provided has not yet been created by the app, FCM uses the channel ID specified in the app manifest.

Signature:

channelId?:string;

AndroidNotification.clickAction

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.

Signature:

clickAction?:string;

AndroidNotification.color

Notification icon color in#rrggbb format.

Signature:

color?:string;

AndroidNotification.defaultLightSettings

If set totrue, use the Android framework's default LED light settings for the notification. Default values are specified inconfig.xml. Ifdefault_light_settings is set totrue andlight_settings is also set, the user-specifiedlight_settings is used instead of the default value.

Signature:

defaultLightSettings?:boolean;

AndroidNotification.defaultSound

If set totrue, use the Android framework's default sound for the notification. Default values are specified inconfig.xml.

Signature:

defaultSound?:boolean;

AndroidNotification.defaultVibrateTimings

If set totrue, use the Android framework's default vibrate pattern for the notification. Default values are specified inconfig.xml. IfdefaultVibrateTimings is set totrue andvibrateTimingsMillis is also set, the default value is used instead of the user-specifiedvibrateTimingsMillis.

Signature:

defaultVibrateTimings?:boolean;

AndroidNotification.eventTimestamp

For notifications that inform users about events with an absolute time reference, sets the time that the event in the notification occurred. Notifications in the panel are sorted by this time.

Signature:

eventTimestamp?:Date;

AndroidNotification.icon

Icon resource for the Android notification.

Signature:

icon?:string;

AndroidNotification.imageUrl

URL of an image to be displayed in the notification.

Signature:

imageUrl?:string;

AndroidNotification.lightSettings

Settings to control the notification's LED blinking rate and color if LED is available on the device. The total blinking time is controlled by the OS.

Signature:

lightSettings?:LightSettings;

AndroidNotification.localOnly

Sets whether or not this notification is relevant only to the current device. Some notifications can be bridged to other devices for remote display, such as a Wear OS watch. This hint can be set to recommend this notification not be bridged. SeeWear OS guides.

Signature:

localOnly?:boolean;

AndroidNotification.notificationCount

Sets the number of items this notification represents. May be displayed as a badge count for Launchers that support badging. SeeNotificationBadge. For example, this might be useful if you're using just one notification to represent multiple new messages but you want the count here to represent the number of total new messages. If zero or unspecified, systems that support badging use the default, which is to increment a number displayed on the long-press menu each time a new notification arrives.

Signature:

notificationCount?:number;

AndroidNotification.priority

Sets the relative priority for this notification. Low-priority notifications may be hidden from the user in certain situations. Note this priority differs fromAndroidMessagePriority. This priority is processed by the client after the message has been delivered. WhereasAndroidMessagePriority is an FCM concept that controls when the message is delivered.

Signature:

priority?:('min'|'low'|'default'|'high'|'max');

AndroidNotification.proxy

Sets if this notification should attempt to be proxied. Must be eitherallow,deny orif_priority_lowered. If unspecified, it remains undefined in the Admin SDK, and defers to the FCM backend's default mapping.

Signature:

proxy?:('allow'|'deny'|'if_priority_lowered');

AndroidNotification.sound

File name of the sound to be played when the device receives the notification.

Signature:

sound?:string;

AndroidNotification.sticky

When set tofalse or unset, the notification is automatically dismissed when the user clicks it in the panel. When set totrue, the notification persists even when the user clicks it.

Signature:

sticky?:boolean;

AndroidNotification.tag

Notification tag. This is an identifier used to replace existing notifications in the notification drawer. If not specified, each request creates a new notification.

Signature:

tag?:string;

AndroidNotification.ticker

Sets the "ticker" text, which is sent to accessibility services. Prior to API level 21 (Lollipop), sets the text that is displayed in the status bar when the notification first arrives.

Signature:

ticker?:string;

AndroidNotification.title

Title of the Android notification. When provided, overrides the title set viaadmin.messaging.Notification.

Signature:

title?:string;

AndroidNotification.titleLocArgs

An array of resource keys that will be used in place of the format specifiers intitleLocKey.

Signature:

titleLocArgs?:string[];

AndroidNotification.titleLocKey

Key of the title string in the app's string resource to use to localize the title text.

Signature:

titleLocKey?:string;

AndroidNotification.vibrateTimingsMillis

Sets the vibration pattern to use. Pass in an array of milliseconds to turn the vibrator on or off. The first value indicates the duration to wait before turning the vibrator on. The next value indicates the duration to keep the vibrator on. Subsequent values alternate between duration to turn the vibrator off and to turn the vibrator on. IfvibrateTimingsMillis is set anddefaultVibrateTimings is set totrue, the default value is used instead of the user-specifiedvibrateTimingsMillis.

Signature:

vibrateTimingsMillis?:number[];

AndroidNotification.visibility

Sets the visibility of the notification. Must be eitherprivate,public, orsecret. If unspecified, it remains undefined in the Admin SDK, and defers to the FCM backend's default mapping.

Signature:

visibility?:('private'|'public'|'secret');

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-04-22 UTC.