Skip to content

Commit 00e6985

Browse files
committed
update README with up-to-date info
1 parent 5171604 commit 00e6985

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

README.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@ $notifications = array(
2828
'endpoint' => 'https://updates.push.services.mozilla.com/push/abc...', // Firefox 43+
2929
'payload' => 'hello !',
3030
'userPublicKey' => 'BPcMbnWQL5GOYX/5LKZXT6sLmHiMsJSiEvIFvfcDvX7IZ9qqtq68onpTPEYmyxSQNiH7UD/98AUcQ12kBoxz/0s=', // base 64 encoded, should be 88 chars
31-
'userAuthToken' => 'RMpCEzkgBaVj0Zj0', // base 64 encoded, should be 16 chars
31+
'userAuthToken' => 'CxVX6QsVToEGEcjfYPqXQw==', // base 64 encoded, should be 24 chars
3232
), array(
3333
'endpoint' => 'https://android.googleapis.com/gcm/send/abcdef...', // Chrome
3434
'payload' => null,
3535
'userPublicKey' => null,
3636
'userAuthToken' => null,
3737
), array(
3838
'endpoint' => 'https://example.com/other/endpoint/of/another/vendor/abcdef...',
39-
'payload' => '{"msg":"test"}',
39+
'payload' => '{msg:"test"}',
4040
'userPublicKey' => '(stringOf88Chars)',
41-
'userAuthToken' => '(stringOf16Chars)',
41+
'userAuthToken' => '(stringOf24Chars)',
4242
),
4343
);
4444

@@ -67,9 +67,6 @@ $webPush->sendNotification(
6767

6868
### GCM servers notes (Chrome)
6969
For compatibility reasons, this library detects if the server is a GCM server and appropriately sends the notification.
70-
GCM servers don't support encrypted payloads yet so WebPush will skip the payload.
71-
If you still want to show that payload on your notification, you should get that data on client-side from your server
72-
where you will have to store somewhere the history of notifications.
7370

7471
You will need to specify your GCM api key when instantiating WebPush:
7572
```php
@@ -87,7 +84,7 @@ $webPush->sendNotification($endpoint, null, null, null, true);
8784
```
8885

8986
### Payload length and security
90-
As previously stated, payload will be encrypted by the library. The maximum payload length is 4078 bytes (or ASCII characters).
87+
Payload will be encrypted by the library. The maximum payload length is 4078 bytes (or ASCII characters).
9188

9289
However, when you encrypt a string of a certain length, the resulting string will always have the same length,
9390
no matter how many times you encrypt the initial string. This can make attackers guess the content of the payload.

0 commit comments

Comments
 (0)