How can I send a notification from Vaadin backend to one or a specific number of (android smartphone) users in a native way?

285 views Asked by At

The problem with PWA is that when the browser is closed (or inactive for smartphones) the user won’t be able to see a notification.

Optimally the PWA icon should receives a number++ and a ring tone to catch the users attention.

It is possible at all? if not what solutions are there?

1

There are 1 answers

0
Leif Åstrand On

What you need is native push notifications.

Vaadin doesn't have built-in support for push notifications, but it is possible to integrate it using the generic JavaScript integration support. You can find an example of this in https://github.com/marcushellberg/vaadin-web-push. You can follow issue #4747 to get updates related to official Vaadin support.

One thing to consider is that this does currently only work for Android devices, but not for iOS. (Update: As of iOS 16, push notifications are also supported on iOS)