demo · v135

Ringtone behaviour — silent, default, or custom

The PWA-for-VoIP use case from the Notifications WG: an incoming-call notification needs to ring, override Do Not Disturb the way a phone does, and let the user pick "answer" without unlocking the device. The silent field controls the ringer; sound lets you point to a custom audio file. Try the three settings below to see the same notification with different ringer profiles.

Requires installed PWA Incoming-call notifications only fire from a PWA with the "incoming-call" action category. The browser ignores them in a regular tab. The preview is a styled mock; click "Try notification" to dispatch a real Notification as a fallback.
Notification permission: ?
JD
Jane Doe
VoIP — ringing
ringer: default

the code

self.registration.showNotification("Jane Doe", {
  scenario: "incoming-call",
  sound: "/audio/ringer.mp3",
  silent: false,
  actions: [
    { action: "answer", title: "Answer" },
    { action: "decline", title: "Decline" },
  ],
});

see also