Send a notification.
public sendNotification ( string $endpoint, string | null $payload = null, string | null $userPublicKey = null, string | null $userAuthToken = null, boolean $flush = false, array $options = [], array $auth = [] ) : array | boolean | ||
$endpoint | string | |
$payload | string | null | If you want to send an array, json_encode it |
$userPublicKey | string | null | |
$userAuthToken | string | null | |
$flush | boolean | If you want to flush directly (usually when you send only one notification) |
$options | array | Array with several options tied to this notification. If not set, will use the default options that you can set in the WebPush object |
$auth | array | Use this auth details instead of what you provided when creating WebPush |
return | array | boolean | Return an array of information if $flush is set to true and the queued requests has failed. Else return true |