PWA testing grounds

Notifications

Notifications in the browser can be sent with 2.5 different methods

  1. new Notification()
  2. serviceworker.showNotification()
  3. Using PushManager API to send a message from backend to a service worker that itself calls showNotification (method 2)

There are some immediate clarifications though:

In the same breath, it may be worth mentioning that for a web app to be installable as PWA, it must

Testing grounds: Notifications

Prerequisites

Served over HTTPSPWA Requirement (mobile)
Installed as PWA
Notifications supported
Notifications permissions
Service worker supported
Service worker installed
Supports PushManager API
PushManager API permissions

Testing

Can't see any notifications? It can be that you're in "Do not disturb" mode on your desktop, or have disabled notifications from in settings.

Method 1Method 2Method 3

Data / settings

Browser

{
  "browser": null,
  "userAgent": null
}

Device

{
  "platform": null,
  "userAgent": null,
  "isMobile": false
}

Notification permission

Push API permission

null

Serviceworker

{}
tomfa@github