Notification

open external class Notification : EventTarget (source)

Platform and version requirements: JS

Exposes the JavaScript Notification to Kotlin

Constructors

<init>

Notification(
    title: String,
    options: NotificationOptions = definedExternally)

Exposes the JavaScript Notification to Kotlin

Properties

actions

open val actions: Array<out NotificationAction>

badge

open val badge: String

body

open val body: String

data

open val data: Any?

dir

open val dir: NotificationDirection

icon

open val icon: String

image

open val image: String

lang

open val lang: String

noscreen

open val noscreen: Boolean

onclick

var onclick: (Event) -> dynamic

onerror

var onerror: (Event) -> dynamic

renotify

open val renotify: Boolean

requireInteraction

open val requireInteraction: Boolean

silent

open val silent: Boolean

sound

open val sound: String

sticky

open val sticky: Boolean

tag

open val tag: String

timestamp

open val timestamp: Number

title

open val title: String

vibrate

open val vibrate: Array<out Int>

Functions

close

fun close()

Inherited Functions

addEventListener

fun addEventListener(
    type: String,
    callback: EventListener?,
    options: dynamic = definedExternally)
fun addEventListener(
    type: String,
    callback: (Event) -> Unit,
    options: dynamic = definedExternally)

dispatchEvent

fun dispatchEvent(event: Event): Boolean

removeEventListener

fun removeEventListener(
    type: String,
    callback: EventListener?,
    options: dynamic = definedExternally)
fun removeEventListener(
    type: String,
    callback: (Event) -> Unit,
    options: dynamic = definedExternally)

Companion Object Properties

maxActions

var maxActions: Int

permission

var permission: NotificationPermission

Companion Object Functions

requestPermission

fun requestPermission(
    deprecatedCallback: (NotificationPermission) -> Unit = definedExternally
): Promise<NotificationPermission>