You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+29-19Lines changed: 29 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -192,30 +192,40 @@ it as a parameter : `$webPush->flush($batchSize)`.
192
192
193
193
### Server errors
194
194
You can see what the browser vendor's server sends back in case it encountered an error (push subscription expiration, wrong parameters...).
195
-
`sendNotification()` (with flush as true) and `flush()` returns true if there were no errors. If there are errors it returns an array like the following.
196
-
The `expired` key can be useful to clean your database of expired endpoints.
195
+
`sendNotification()` (with `$flush` as `true`) and `flush()`**always**returns a [`\Generator`](http://php.net/manual/en/language.generators.php) with [`MessageSentReport`](https://github.com/web-push-libs/web-push-php/blob/master/src/MessageSentReport.php) objects, even if you just send one notification.
196
+
To loop through the results, just pass it into `foreach`. You can also use [`iterator_to_array`](http://php.net/manual/en/function.iterator-to-array.php) to check the contents while debugging.
0 commit comments