Skip to content

Commit 5994039

Browse files
committed
Add useful links for reference
1 parent 6839ba5 commit 5994039

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

PushMessageFromServer.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// https://developers.google.com/web/updates/2015/05/notifying-you-of-changes-to-notifications
2+
// https://felixgerschau.com/web-push-notifications-tutorial/
3+
// https://developers.google.com/web/fundamentals/codelabs/push-notifications
14
const webpush = require('web-push');
25

36
// VAPID keys should be generated only once with:
@@ -25,8 +28,5 @@ webpush.setVapidDetails(
2528
// }
2629
// };
2730

28-
const pushSubscription =
2931
const notification = { title: `Hello at ${(new Date()).toISOString()}` };
30-
31-
32-
webpush.sendNotification(pushSubscription,);
32+
webpush.sendNotification(pushSubscription, JSON.stringify(notification));

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@
22

33
yarn create react-app web-push-api-example --template typescript
44
required Node.js version >= 14
5+
6+
7+
# Notification does not always show as banner.
8+
Turn of focus assist

0 commit comments

Comments
 (0)