Property | Type | Description | |
---|---|---|---|
$auth | array | ||
$browser | Buzz\Browser |
Method | Description | |
---|---|---|
__construct ( array $auth = [], array $defaultOptions = [], integer | null $timeout = 30, Buzz\Client\AbstractClient $client = null ) | WebPush constructor. | |
flush ( ) : array | boolean | Flush notifications. Triggers the requests. | |
getAutomaticPadding ( ) : integer | ||
getBrowser ( ) : Buzz\Browser | ||
getDefaultOptions ( ) : array | ||
isAutomaticPadding ( ) : boolean | ||
sendNotification ( string $endpoint, string | null $payload = null, string | null $userPublicKey = null, string | null $userAuthToken = null, boolean $flush = false, array $options = [], array $auth = [] ) : array | boolean | Send a notification. | |
setAutomaticPadding ( integer $automaticPadding ) : |
||
setBrowser ( Buzz\Browser $browser ) : |
||
setDefaultOptions ( array $defaultOptions ) |
Method | Description | |
---|---|---|
prepareAndSend ( array $notifications ) | ||
sendRequest ( string $url, array $headers, string $content ) : Buzz\Message\MessageInterface | null |
public __construct ( array $auth = [], array $defaultOptions = [], integer | null $timeout = 30, Buzz\Client\AbstractClient $client = null ) | ||
$auth | array | Some servers needs authentication |
$defaultOptions | array | TTL, urgency, topic |
$timeout | integer | null | Timeout of POST request |
$client | Buzz\Client\AbstractClient |
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 |
public setAutomaticPadding ( integer $automaticPadding ) : |
||
$automaticPadding | integer | Max padding length |
return |
public setBrowser ( Buzz\Browser $browser ) : |
||
$browser | Buzz\Browser | |
return |
public setDefaultOptions ( array $defaultOptions ) | ||
$defaultOptions | array | Keys 'TTL' (Time To Live, defaults 4 weeks), 'urgency', and 'topic' |