diff --git a/incoming-call-notifications/call.png b/incoming-call-notifications/call.png new file mode 100644 index 00000000..26391872 Binary files /dev/null and b/incoming-call-notifications/call.png differ diff --git a/incoming-call-notifications/icon.png b/incoming-call-notifications/icon.png index 56681bfa..278b3d22 100644 Binary files a/incoming-call-notifications/icon.png and b/incoming-call-notifications/icon.png differ diff --git a/incoming-call-notifications/index.html b/incoming-call-notifications/index.html index 91e45a78..6d39c1f0 100644 --- a/incoming-call-notifications/index.html +++ b/incoming-call-notifications/index.html @@ -4,7 +4,7 @@ - Incoming Call Notifications API + Notifications demo @@ -18,6 +18,7 @@ font-family: inherit; font-size: inherit; margin: 1rem 0; + display: block; } body { @@ -39,7 +40,7 @@ -

Incoming call notifications API

+

Notifications demo

Test

@@ -60,14 +61,6 @@

Log

const notificationBtn = document.getElementById("notification"); const callBtn = document.getElementById("call"); - // A counter to keep track of the number of notifications shown. - let notificationId = localStorage.getItem("notificationId"); - if (notificationId === null) { - notificationId = 1; - localStorage.setItem("notificationId", notificationId); - } - - // The service worker registration. let serviceWorkerRegistration = null; function log(message) { @@ -96,9 +89,8 @@

Log

function showNotification() { if (serviceWorkerRegistration !== null) { - serviceWorkerRegistration.showNotification(`Notification ${++notificationId}`, { - body: `Notification ${notificationId} description`, - icon: "./icon.png" + serviceWorkerRegistration.showNotification("Notification", { + body: "This is a notification example", }).then(() => { log("showNotification() succeeded"); }).catch((error) => { @@ -109,9 +101,9 @@

Log

function showIncomingCallNotification() { if (serviceWorkerRegistration !== null) { - serviceWorkerRegistration.showNotification(`Incoming call ${++notificationId}`, { - body: `Incoming call ${notificationId} description`, - icon: "./icon.png", + serviceWorkerRegistration.showNotification("Incoming call", { + body: "This is an incoming call notification example. Someone is calling.", + icon: "./call.png", scenario: "incoming-call", actions: [ { action: "accept-audio-call", title: "audio" }, diff --git a/incoming-call-notifications/manifest.json b/incoming-call-notifications/manifest.json index 72bfd705..638259fe 100644 --- a/incoming-call-notifications/manifest.json +++ b/incoming-call-notifications/manifest.json @@ -4,8 +4,8 @@ "display": "standalone", "scope": "./", "start_url": "./index.html", - "name": "Incoming Call Notifications", - "short_name": "ICN", + "name": "Notifications demo", + "short_name": "Notifications demo", "icons": [ { "src": "icon.png",