I know you can send push notifications to a user who has installed the pwa. However, this always requires a server which sends that notification and also the end user device to be online to recieve and show it.
I was wondering if there is a way to "schedule" a push notification to be shown later, like it is possible on Android to be able to realize something like reminders for events, without the need to have an internet connections.
EDIT: Since Chrome 80, notification triggers are available as an origin trial.
all support native push notifications. Beyond the browser Windows and Android both support push. And if you are wondering if Edge, FireFox or Chrome on iOS support push, they don't.
There is Notifications which works offline, but you cannot call it from "background" (e.g. when your web page is closed).
There are at least 3 web APIs/specs in the development related to some form of the scheduled tasks. None of them are in production though.
Periodic Background Sync API
Main feature: it enables a web app to run tasks periodically while the device has network connectivity
Notification Triggers (a.k.a. Scheduled Notification API / Event Alarms)
Main feature: this allows to show a notification (nothing else) reliably at a specific time in the future, even if the device is offline
Scheduled Task API (Generic Alarms)
Main feature: schedule code to run at a specified time in the future - cron for the Web
So answering the original question: your choice is Notification Triggers API. Hopefully this will land in the browsers soon.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With