Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
andreinwald authored Mar 19, 2024
1 parent 42c97b3 commit a2a1b54
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ _WebPush - is browser technology that allows site developer send notifications f
- [Basic WebPush subscription code](#Basic-WebPush-subscription-code)
- [Generating VAPID key](#Generating-VAPID-key)
- [Installing PWA on iOS by adding to Home Screen](#Installing-PWA-on-iOS-by-adding-to-Home-Screen)
- [Subscription and saving token](#Subscription-and-saving-token)
- [Subscription and saving token (Prompt with permission)](#Subscription-and-saving-token)
- [Service worker](#Service-worker)
- [Sending push message](#Sending-push-message)

Expand Down Expand Up @@ -96,7 +96,10 @@ WebPush is Progressive Web App(PWA) feature so you need to ask user to enable PW
On iOs devices it can be made with button **"Add to Home Screen"** in browser.<br><br>
<img src="images/webpush-add-to-home-screen.jpg" alt="Require adding to Home Screen" style="height:400px">

**Also don't forget to set display mode in manifest.json!**
Also don't forget to set display mode in **manifest.json**!<br>
Manifest.json required to set "display: standalone", that called by Apple "Home Screen web app"<br>
PushManager will appear in serviceWorker object **only after** adding site to Home screen at your iPhone.

```html
<html>
<head>
Expand All @@ -122,6 +125,7 @@ if (window.navigator.standalone) {


## Subscription and saving token
(Displaying Prompt with permission)<br>
After registering Service Worker and providing VAPID_PUBLIC_KEY you can request user to subscribe.<br>
Best practice will be to ask user about subscription in html popup first.<br>
Then you can call:
Expand Down

0 comments on commit a2a1b54

Please sign in to comment.