This is a project for testing iOS PWA notifications.
I wasn’t sure how they worked when I started this project, but now I kinda have a better idea now :)
Disclaimer: The code is somewhat messy because I just wanted to learn.
Requirements:
- Java 21
- Vaadin 24
- MariaDB (for user testing)
- NodeJS 18 or higher
- HTTPS connection to the server running it (more on that below)
Running the app:
- Clone this repository, then open it in your favorite editor (mine is IntelliJ Community Edition).
- Go to the
application.properties
file and edit the MariaDB credentials and the launch port if you wish (default is8080
). - Open a terminal and generate the public and private VAPID keys:
npx web-push generate-vapid-keys
- Add these keys to the
application.properties
file.- If you changed the port, make sure you also update the
subject
property accordingly.
- If you changed the port, make sure you also update the
- Locate the
Application
class and run the main method.
To test push notifications, you must use HTTPS for the Vaadin server connection.
For some reason, Apple’s iOS PWA notifications won’t work over plain HTTP, so I recommend using ngrok (or a similar service) to provide an encrypted tunnel.
This project is not meant for production—it’s purely for testing!
However, if you still want to package it for production for any reason, you can run:
./mvnw clean package -Pproduction