Notification

open class Notification(val title: String, options: NotificationOptions = definedExternally) : EventTarget(source)

The Notification interface of the Notifications API is used to configure and display desktop notifications to the user.

MDN Reference

Constructors

Link copied to clipboard
constructor(title: String, options: NotificationOptions = definedExternally)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The body read-only property of the specified in the body option of the A string.

Link copied to clipboard
val data: JsAny?

The data read-only property of the data, as specified in the data option of the The notification's data can be any arbitrary data that you want associated with the notification.

Link copied to clipboard

The dir read-only property of the Notification interface indicates the text direction of the notification, as specified in the dir option of the Notification.Notification constructor.

Link copied to clipboard

The icon read-only property of the part of the notification, as specified in the icon option of the A string.

Link copied to clipboard

The lang read-only property of the as specified in the lang option of the The language itself is specified using a string representing a language tag according to MISSING: RFC(5646, 'Tags for Identifying Languages (also known as BCP 47)')].

Link copied to clipboard

The requireInteraction read-only property of the Notification interface returns a boolean value indicating that a notification should remain active until the user clicks or dismisses it, rather than closing automatically.

Link copied to clipboard

The silent read-only property of the silent, i.e., no sounds or vibrations should be issued regardless of the device settings.

Link copied to clipboard
val tag: String

The tag read-only property of the as specified in the tag option of the The idea of notification tags is that more than one notification can share the same tag, linking them together.

Link copied to clipboard

The title read-only property of the specified in the title parameter of the A string.

Functions

Link copied to clipboard
fun close()

The close() method of the Notification interface is used to close/remove a previously displayed notification.

Link copied to clipboard
Link copied to clipboard