@Generated(value="org.realityforge.webtack")
@JsType(isNative=true,
namespace="<global>",
name="Notification")
public class Notification
extends EventTarget
| Modifier and Type | Field and Description |
|---|---|
EventHandler |
onclick
The onclick property of the Notification interface specifies an event listener to receive click events.
|
EventHandler |
onclose
The onclose property of the Notification interface specifies an event listener to receive close events.
|
EventHandler |
onerror
The onerror property of the Notification interface specifies an event listener to receive error events.
|
EventHandler |
onshow
The onshow property of the Notification interface specifies an event listener to receive show events.
|
| Constructor and Description |
|---|
Notification(java.lang.String title)
The Notification() constructor creates a new Notification object instance, which represents a user notification.
|
Notification(java.lang.String title,
NotificationOptions options)
The Notification() constructor creates a new Notification object instance, which represents a user notification.
|
| Modifier and Type | Method and Description |
|---|---|
JsArray<NotificationAction> |
actions()
The actions read-only property of the Notification interface returns the list of NotificationAction objects set using the actions option when creating the notification using the Notification() constructor.
|
java.lang.String |
badge()
The badge property of the Notification interface returns the URL of the image used to represent the notification when there is not enough space to display the notification itself.
|
java.lang.String |
body()
The body read-only property of the Notification interface indicates the body string of the notification, as specified in the body option of the Notification() constructor.
|
void |
close()
The close() method of the Notification interface is used to close/remove a previously displayed notification.
|
jsinterop.base.Any |
data()
The data read-only property of the Notification interface returns a structured clone of the notification's data, as specified in the data option of the Notification() constructor.
|
java.lang.String |
dir()
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() constructor.
|
java.lang.String |
icon()
The icon read-only property of the Notification interface contains the URL of an icon to be displayed as part of the notification, as specified in the icon option of the Notification() constructor.
|
java.lang.String |
image()
The image read-only property of the Notification interface contains the URL of an image to be displayed as part of the notification
|
java.lang.String |
lang()
The lang read-only property of the Notification interface indicates the language used in the notification, as specified in the lang option of the Notification() constructor.
|
static int |
maxActions()
The maxActions attribute of the Notification interface returns the maximum number of actions supported by the device and the User Agent.
|
static java.lang.String |
permission()
The permission read-only property of the Notification interface indicates the current permission granted by the user for the current origin to display web notifications.
|
boolean |
renotify()
The renotify read-only property of the Notification interface specifies whether the user should be notified after a new notification replaces an old one, as specified in the renotify option of the Notification() constructor.
|
static Promise<java.lang.String> |
requestPermission()
The requestPermission() method of the Notification interface requests permission from the user for the current origin to display notifications.
|
static Promise<java.lang.String> |
requestPermission(NotificationPermissionCallback deprecatedCallback)
The requestPermission() method of the Notification interface requests permission from the user for the current origin to display notifications.
|
boolean |
requireInteraction()
The requireInteraction read-only property of the Notification interface returns a Boolean indicating that a notification should remain active until the user clicks or dismisses it, rather than closing automatically.
|
boolean |
silent()
The silent read-only property of the Notification interface specifies whether the notification should be silent, i.e., no sounds or vibrations should be issued, regardless of the device settings.
|
java.lang.String |
tag()
The tag read-only property of the Notification interface signifies an identifying tag for the notification, as specified in the tag option of the Notification() constructor.
|
int |
timestamp()
The timestamp read-only property of the Notification interface returns a DOMTimeStamp, as specified in the timestamp option of the Notification() constructor.
|
java.lang.String |
title()
The title read-only property of the Notification interface indicates the title of the notification, as specified in the title parameter of the Notification() constructor.
|
JsArray<java.lang.Double> |
vibrate()
The vibrate read-only property of the Notification interface specifies a a vibration pattern for the device's vibration hardware to emit when the notification fires.
|
addEventListener, addEventListener, addEventListener, dispatchEvent, removeEventListener, removeEventListener, removeEventListenerassign, create, create, defineProperties, defineProperty, defineProperty, entries, freeze, fromEntries, getOwnPropertyDescriptor, getOwnPropertyDescriptor, getOwnPropertyDescriptors, getOwnPropertyNames, getOwnPropertySymbols, getPrototypeOf, hasOwnProperty, hasOwnProperty, is, isExtensible, isFrozen, isPrototypeOf, isSealed, keys, preventExtensions, propertyIsEnumerable, seal, setPrototypeOf, toString_, valueOf_, values@Nullable public EventHandler onclick
@Nullable public EventHandler onclose
@Nullable public EventHandler onerror
@Nullable public EventHandler onshow
public Notification(@Nonnull
java.lang.String title,
@Nonnull
NotificationOptions options)
public Notification(@Nonnull
java.lang.String title)
@JsProperty(name="actions") @Nonnull public JsArray<NotificationAction> actions()
@JsProperty(name="badge") @Nonnull public java.lang.String badge()
@JsProperty(name="body") @Nonnull public java.lang.String body()
@JsProperty(name="data") @Nullable public jsinterop.base.Any data()
@JsProperty(name="dir") @Nonnull @NotificationDirection public java.lang.String dir()
@JsProperty(name="icon") @Nonnull public java.lang.String icon()
@JsProperty(name="image") @Nonnull public java.lang.String image()
@JsProperty(name="lang") @Nonnull public java.lang.String lang()
@JsProperty(name="maxActions") public static int maxActions()
@JsProperty(name="permission") @Nonnull @NotificationPermission public static java.lang.String permission()
@JsProperty(name="renotify") public boolean renotify()
@JsProperty(name="requireInteraction") public boolean requireInteraction()
@JsProperty(name="silent") public boolean silent()
@JsProperty(name="tag") @Nonnull public java.lang.String tag()
@JsProperty(name="timestamp") public int timestamp()
@JsProperty(name="title") @Nonnull public java.lang.String title()
@JsProperty(name="vibrate") @Nonnull public JsArray<java.lang.Double> vibrate()
@Nonnull public static Promise<java.lang.String> requestPermission(@Nonnull NotificationPermissionCallback deprecatedCallback)
@Nonnull public static Promise<java.lang.String> requestPermission()
public void close()