diff --git a/README.md b/README.md index 026809e..3b4591b 100644 --- a/README.md +++ b/README.md @@ -13,12 +13,44 @@ _WebPush - is browser technology that allows site developer send notifications f --- # More info +- [Basic WebPush subscription code](#Basic-WebPush-subscription-code) - [Installing PWA](#Installing-PWA) - [Generating VAPID key](#Generating-VAPID-key) - [Subscription and saving token](#Subscription-and-saving-token) - [Service worker](#Service-worker) - [Sending push message](#Sending-push-message) +## Basic WebPush subscription code +Example of basic subscription code, that works in Google Chrome and Firefox.
+```html + + + + + + + +``` +You can run it locally by creating index.html and serviceworker.js files with a simple html server: +```shell +npx http-server +``` + ## Installing PWA WebPush is Progressive Web App(PWA) feature so you need to ask user to enable PWA mode first.
On iOs devices it can be made with button **"Add to Home Screen"** in browser.