Browser Notifications for Flow apps

This addons allows using Notification API in Flow app, both local and push (via Service Workers).

Why would you want to use (push) notifications in your Vaadin application? Let's say that your application does some long, long processing, in the order of tens of minutes. In that case you don't want to block the UI. Instead you want to do the processing in the background (maybe even on a different machine) and when it's done let the user know that the wait is over and maybe even give them an option to go to the results of processing, decide what to do next etc. You could for example send an email. Or you could also push a notification. With push notification your app doesn't even need to be open in the browser. On a mobile device you will get a notification that will look the same as notification from a native mobile app.

Currently the add-on only allows querying for support of the API in the browser and checking whether user allowed displaying notifications from the origin of the application. The roadmap is following:

  1. Add a method to actually ask user for permission to display notifications. ✔️
  2. Add an API to display local notifications. Almost ✔️
  3. Add a method to subscribe the user to push notifications via W3 standard API (https://w3c.github.io/push-api/)
  4. (Huge maybe) Implement Java API to send push messages (from your application server). Consider using https://github.com/web-push-libs/webpush-java
  5. Implement Safari's push notifications
  6. (Huge maybe) Implement Java API to send push messages to Safari users.

Beware that if you intend to use the addon on any host other than localhost you will need to serve your webapp over HTTPS

Install

Link to this version
ExperimentalReleased 18 July 2018GNU Affero General Public License v3.0
Framework Support
Vaadin platform 10+
Browser Compatibility
11
Install with
Release notes - Version 0.3-SNAPSHOT