Web Notifications API

Web Notifications Add-on for Vaadin 8

This is a Vaadin extension to support the (Web) Notifications API. This allows you to show notifications directly on the user's desktop, regardless of whether browser or browser tab are currently visible.

There are two competing specifications for this API: one from the WHATWG and one from the W3C. They share features, but there are differences. And differing browser support on different platforms makes the situation even more complicated. That's an abyss that I didn't want to fully explore.

If you just want to show notifications without getting down to the nitty-gritty of browser support, the following options should be rather safe to use - at least in desktop browsers:

  • body(String)
  • icon(String)
  • tag(String)
  • onClick(Runnable)
  • onError(Runnable)
  • timeout(Integer)
  • closeOnClick(boolean)

This extension needs to be attached to a UI and needs to request the user's permission to show notifications. However all that is taken care of automatically.

Uses notify.js by Alex Gibson.

Install

Link to this version
BetaReleased 08 July 2017MIT License
Framework Support
Vaadin 8.0+
Browser Compatibility
Install with
Release notes - Version 0.9.5
  • Ensure that notification is shown with UI access.
  • Make the callback Runnables serializable.
  • Add option to focus browser and tab on click.