Save the date - Google I/O returns May 18-20. Register to get the most out of the digital experience: Build your schedule, reserve space, participate in Q&As;, earn Google Developer profile badges, and more. Register now

Represents the WebPush-specific notification options that can be included in messaging.WebpushConfig. This supports most of the standard options as defined in the Web Notification specification.

Indexable

[key: string]: any

Represents the WebPush-specific notification options that can be included in messaging.WebpushConfig. This supports most of the standard options as defined in the Web Notification specification.

Index

Properties

Optional actions

actions: Array<{ action: string; icon?: undefined | string; title: string }>

An array of notification actions representing the actions available to the user when the notification is presented.

Optional badge

badge: undefined | string

URL of the image used to represent the notification when there is not enough space to display the notification itself.

Optional body

body: undefined | string

Body text of the notification.

Optional data

data: any

Arbitrary data that you want associated with the notification. This can be of any data type.

Optional dir

dir: "auto" | "ltr" | "rtl"

The direction in which to display the notification. Must be one of auto, ltr or rtl.

Optional icon

icon: undefined | string

URL to the notification icon.

Optional image

image: undefined | string

URL of an image to be displayed in the notification.

Optional lang

lang: undefined | string

The notification's language as a BCP 47 language tag.

Optional renotify

renotify: undefined | false | true

A boolean specifying whether the user should be notified after a new notification replaces an old one. Defaults to false.

Optional requireInteraction

requireInteraction: undefined | false | true

Indicates that a notification should remain active until the user clicks or dismisses it, rather than closing automatically. Defaults to false.

Optional silent

silent: undefined | false | true

A boolean specifying whether the notification should be silent. Defaults to false.

Optional tag

tag: undefined | string

An identifying tag for the notification.

Optional timestamp

timestamp: undefined | number

Timestamp of the notification. Refer to https://developer.mozilla.org/en-US/docs/Web/API/notification/timestamp for details.

Optional title

title: undefined | string

Title text of the notification.

Optional vibrate

vibrate: number | number[]

A vibration pattern for the device's vibration hardware to emit when the notification fires.