@@ -28,17 +28,17 @@ $notifications = array(
28
28
'endpoint' => 'https://updates.push.services.mozilla.com/push/abc...', // Firefox 43+
29
29
'payload' => 'hello !',
30
30
'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
32
32
), array(
33
33
'endpoint' => 'https://android.googleapis.com/gcm/send/abcdef...', // Chrome
34
34
'payload' => null,
35
35
'userPublicKey' => null,
36
36
'userAuthToken' => null,
37
37
), array(
38
38
'endpoint' => 'https://example.com/other/endpoint/of/another/vendor/abcdef...',
39
- 'payload' => '{" msg" :"test"}',
39
+ 'payload' => '{msg:"test"}',
40
40
'userPublicKey' => '(stringOf88Chars)',
41
- 'userAuthToken' => '(stringOf16Chars )',
41
+ 'userAuthToken' => '(stringOf24Chars )',
42
42
),
43
43
);
44
44
@@ -67,9 +67,6 @@ $webPush->sendNotification(
67
67
68
68
### GCM servers notes (Chrome)
69
69
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.
73
70
74
71
You will need to specify your GCM api key when instantiating WebPush:
75
72
``` php
@@ -87,7 +84,7 @@ $webPush->sendNotification($endpoint, null, null, null, true);
87
84
```
88
85
89
86
### 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).
91
88
92
89
However, when you encrypt a string of a certain length, the resulting string will always have the same length,
93
90
no matter how many times you encrypt the initial string. This can make attackers guess the content of the payload.
0 commit comments