Skip to content

Commit 99e0297

Browse files
committed
update README with new API
1 parent 2815e86 commit 99e0297

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,15 @@ $endpoints = array(
2828
);
2929

3030
$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);
3340
```
3441

3542
### GCM servers notes (Chrome)
@@ -50,7 +57,7 @@ $apiKeys = array(
5057
);
5158

5259
$webPush = new WebPush($apiKeys);
53-
$webPush->sendNotification($endpoint);
60+
$webPush->sendNotification($endpoint, true);
5461
```
5562

5663
### Changing the browser client

0 commit comments

Comments
 (0)