Skip to content

Commit

Permalink
Icon and string changes
Browse files Browse the repository at this point in the history
  • Loading branch information
captainbrosset committed Nov 5, 2024
1 parent 3c456eb commit 7f3f0bf
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 18 deletions.
Binary file added incoming-call-notifications/call.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified incoming-call-notifications/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 8 additions & 16 deletions incoming-call-notifications/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Incoming Call Notifications API</title>
<title>Notifications demo</title>
<link rel="icon" type="image/png" href="https://edgestatic.azureedge.net/welcome/static/favicon.png">
<link rel="manifest" href="manifest.json">

Expand All @@ -18,6 +18,7 @@
font-family: inherit;
font-size: inherit;
margin: 1rem 0;
display: block;
}

body {
Expand All @@ -39,7 +40,7 @@
</head>

<body>
<h1>Incoming call notifications API</h1>
<h1>Notifications demo</h1>

<div id="buttons">
<h2>Test</h2>
Expand All @@ -60,14 +61,6 @@ <h2>Log</h2>
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) {
Expand Down Expand Up @@ -96,9 +89,8 @@ <h2>Log</h2>

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) => {
Expand All @@ -109,9 +101,9 @@ <h2>Log</h2>

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" },
Expand Down
4 changes: 2 additions & 2 deletions incoming-call-notifications/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 7f3f0bf

Please sign in to comment.