Skip to content

Latest commit

 

History

History
32 lines (15 loc) · 897 Bytes

web-push.md

File metadata and controls

32 lines (15 loc) · 897 Bytes

How To show the Allow Notifications Dialog

If by accident we click "Deny" in the Allow Notifications dialog after hitting subscribe,

In order to trigger again the Allow Notifications popup, we need first to clear localhost from this list - chrome://settings/content/notifications

Generating VAPID keys

In order to generate a public/private VAPID key pair, we first need to install the web-push library globally:

npm install web-push -g

We can then generate a VAPID key pair with this command:

web-push generate-vapid-keys --json

And here is a sample output of this command:

    {
        "publicKey": "BF1BhDhSW89yKw6pWbLlzcDpCR3I3ViSCEiS_z0q_RP9-ablo5Up8HDIEP1-GauARtU7MxB6Yl_7FI8UvczPmaQ",
        "privateKey": "6XaIXj1cbSoaCpxSbOA-xYWHSISVSMCPUcSvEcczxkg"
    }