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 tried it, it’s working like expected :slight_smile:

Thank you !

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’,”);