Class WebNotification
java.lang.Object
org.vaadin.firitin.util.webnotification.WebNotification
A utility class for displaying web notifications (aka native OS displayed notifications)
in a Vaadin application. It provides methods to show notifications, check permission status, and request permissions.
Usage:
WebNotification notification = WebNotification.get(); notification.showNotification("Hello World!");
Compared to Vaadin's built-in notification system, this allows notifications to be displayed even when the browser window is not in focus, using the native OS notification system. Regular Vaadin notifications are more flexible for in-app notifications.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic WebNotification
get()
void
requestPermission
(Runnable onSuccess, Runnable onError) void
showNotification
(String msg) void
showNotification
(String msg, NotificationOptions options) void
void
showNotificationAsync
(String msg, NotificationOptions options)
-
Constructor Details
-
WebNotification
public WebNotification(com.vaadin.flow.component.UI ui)
-
-
Method Details
-
get
-
showNotification
-
showNotification
-
showNotificationAsync
-
showNotificationAsync
-
checkPermission
-
requestPermission
-