Skip to content

Commit 9f0ddc9

Browse files
committed
clarify a bit things with VAPID
1 parent 7fa75d1 commit 9f0ddc9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ There are several good examples and tutorials on the web:
7171
* you may want to take a look at my own implementation: [sw.js](https://github.com/Minishlink/physbook/blob/02a0d5d7ca0d5d2cc6d308a3a9b81244c63b3f14/web/service-worker.js) and [app.js](https://github.com/Minishlink/physbook/blob/02a0d5d7ca0d5d2cc6d308a3a9b81244c63b3f14/app/Resources/public/js/app.js)
7272

7373
### Authentication (VAPID)
74-
Browsers need to verify your identity. A standard called VAPID can authenticate you for all browsers. You'll need to create and provide a public and private key for your server.
74+
Browsers need to verify your identity. A standard called VAPID can authenticate you for all browsers. You'll need to create and provide a public and private key for your server. These keys must be safely stored and should not change.
7575

76-
You can specify your authentication details when instantiating WebPush. The keys can be passed directly, or you can load a PEM file or its content:
76+
You can specify your authentication details when instantiating WebPush. The keys can be passed directly (recommended), or you can load a PEM file or its content:
7777
```php
7878
<?php
7979

@@ -85,15 +85,15 @@ $auth = array(
8585
'GCM' => 'MY_GCM_API_KEY', // deprecated and optional, it's here only for compatibility reasons
8686
'VAPID' => array(
8787
'subject' => 'mailto:[email protected]', // can be a mailto: or your website address
88-
'publicKey' => '~88 chars', // uncompressed public key P-256 encoded in Base64-URL
89-
'privateKey' => '~44 chars', // in fact the secret multiplier of the private key encoded in Base64-URL
88+
'publicKey' => '~88 chars', // (recommended) uncompressed public key P-256 encoded in Base64-URL
89+
'privateKey' => '~44 chars', // (recommended) in fact the secret multiplier of the private key encoded in Base64-URL
9090
'pemFile' => 'path/to/pem', // if you have a PEM file and can link to it on your filesystem
9191
'pem' => 'pemFileContent', // if you have a PEM file and want to hardcode its content
9292
),
9393
);
9494

9595
$webPush = new WebPush($auth);
96-
$webPush->sendNotification($endpoint, null, null, null, true);
96+
$webPush->sendNotification(...);
9797
```
9898

9999
In order to generate the uncompressed public and secret key, encoded in Base64, enter the following in your Linux bash:

0 commit comments

Comments
 (0)