Notifications
Published
Notifications are how an installed PWA re-engages users after they leave: a server pushes a message, the service worker wakes to handle it, and a system notification appears. The power comes with a strict permission model (ask in context, on a gesture) and platform rules, notably that iOS requires the PWA to be installed to the Home Screen first.
These entries cover the push pipeline, the permission model, and periodic background updates.
In this section
Section titled “In this section”Web Push and PushManager.subscribe()How PushManager.subscribe() creates a VAPID-keyed PushSubscription, what endpoint, p256dh, and auth are for, and how push events reach the service worker.
Periodic background sync for content updatesWhen periodic background sync is the right tool for refreshing content, how Chrome gates it on installation and engagement, and how to test it.
Web Push on iOS and iPadOS (16.4+)Web Push for Home Screen web apps on iOS 16.4: the install requirement, the missing Notification interface in a tab, APNs delivery, and Declarative Web Push.
Notification actions and badge optionsThe actions and badge options of showNotification(): their fields, the two-button limit behind Notification.maxActions, the 96 by 96 badge, and engine support.
Notification triggers (showTrigger)What Chrome's Notification Triggers proposal added to showNotification() behind a flag, the showTrigger option and TimestampTrigger, and why it ended.
Notification interfaceThe Notification() constructor and its object: instance properties, the click, close, and error events, and why mobile browsers throw on the constructor.
Notifications APIShowing system notifications with showNotification() and getNotifications(), the persistent versus non-persistent split, and the TypeError paths.
Notification.requestPermission()How Notification.requestPermission() and Notification.permission work, the user-gesture rule Firefox 72 and Safari enforce, and Firefox's console messages.
Push subscription expiry and refreshWhat a subscription expiration time means, what pushsubscriptionchange carries on a refresh or a loss, and the Firefox versions that omit its two members.
← Back to the Reference overview.