Push Notifications - Any platform
OS Level push notifications can be reliable sent from a PWA using a web app manifest, service worker, and Push API enables PWA push notifications on Android, iOS, Windows, macOS, and Linux through compatible browsers. Support varies by platform and browser, with full functionality typically requiring home screen installation and user permission.
Implementation details per OS:
Android
Chrome and compatible browsers fully support this stack for installed PWAs, with service workers handling push events via the Push API and Notifications API. Implement by registering a service worker (e.g., navigator.serviceWorker.register('/sw.js')), requesting Notification.permission(), generating VAPID keys for subscriptions, and sending pushes via FCM endpoints. Limitations include Android battery optimizations killing background processes (advise users to whitelist), no support in browser tabs without installation, and potential throttling on some devices.
iOS
Safari from iOS 16.4+ and iPadOS 16.4+ supports this for PWAs added to the home screen, using the same service worker and Push API flow. Register the service worker, add a manifest with display: standalone, request permissions, and handle push events to show notifications. Limitations: No support in Safari tabs or in-app browsers; badges/actions are inconsistent; requires explicit home screen add; storage isolation prevents detection from browser; no FCM—uses Apple's push service.
Windows
Edge and Chrome provide excellent support for installed PWAs, integrating with Windows notifications including badges and actions. Include a manifest with icons/short_name, register service worker, subscribe via PushManager with VAPID, and ensure browser runs at startup for background delivery. Limitations: Firefox support is partial; notifications cease if browser closes fully; no native install prompt in all browsers.
macOS
Chrome and Edge enable full push functionality for installed PWAs, with service workers persisting for offline handling and Push API subscriptions. Setup mirrors desktop Chrome: manifest validation, service worker for push/notificationclick events, and server-side payload delivery. Limitations: Safari lacks push support entirely; relies on Chromium browsers staying active; macOS notification center grouping can bury alerts; no unified badges across apps.
Linux
Chrome/Edge offer solid support in distributions like Ubuntu, with PWAs installable via browser and Push API working through service workers. Register worker, use display: standalone in manifest, handle subscriptions, and test daemon integration (e.g., GNOME/KDE). Limitations: Firefox experimental/flag-dependent; heavy reliance on browser process running; distro notification daemons vary in appearance/actions; background sync unreliable without persistent flags.
Implement this in a way that causes minimal cost to the webhost, and has minimal dependency on external api's
NotificationsDevelopmentMarketing