Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Notification outside UI
Hello,
Is there a way to achieve displaying of a notification to the user when the browser is minimized on the status bar ? (the browser should remain minimized during displaying of the notification )
Thank you
Hello,
Following add-on is doing so : https://vaadin.com/directory#!addon/webnotifications
Never tried it, but demo is working on my desktop.
Regards
I found also other method : using the Push.js library (https://nickersoft.github.io/push.js/)
public void testNotification()
{
StringBuffer sb = new StringBuffer();
sb.append("Push.create(\"Hello world!\", { ");
sb.append("body: \"How's it hangin'?\",");
sb.append("icon: 'info.png',");
sb.append("timeout: 4000,");
sb.append("onClick: function () {");
sb.append("window.focus();");
sb.append("this.close();");
sb.append("}");
sb.append("});");
Page.getCurrent().getJavaScript().execute(sb.toString());
}
but I have a problem displaying the icon : where should be placed the image file in the project structure and which path should I use ?
I found the solution: put the image file in the img folder and call
sb.append("icon: '/AppName/VAADIN/themes/mytheme/img/info.png',");