File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -28,8 +28,15 @@ $endpoints = array(
28
28
);
29
29
30
30
$webPush = new WebPush();
31
- $webPush->sendNotification($endpoints[0]); // send one notification
32
- $webPush->sendNotifications($endpoints); // send multiple notifications
31
+
32
+ // send multiple notifications
33
+ foreach ($endpoints as $endpoint) {
34
+ $webPush->sendNotification($endpoint);
35
+ }
36
+ $webPush->flush();
37
+
38
+ // send one notification and flush directly
39
+ $webPush->sendNotification($endpoints[0], true);
33
40
```
34
41
35
42
### GCM servers notes (Chrome)
@@ -50,7 +57,7 @@ $apiKeys = array(
50
57
);
51
58
52
59
$webPush = new WebPush($apiKeys);
53
- $webPush->sendNotification($endpoint);
60
+ $webPush->sendNotification($endpoint, true );
54
61
```
55
62
56
63
### Changing the browser client
You can’t perform that action at this time.
0 commit comments