PHP Class LaravelFCM\Message\OptionsBuilder

Class OptionsBuilder
Mostrar archivo Open project: brozot/laravel-fcm Class Usage Examples

Protected Properties

Property Type Description
$collapseKey string
$contentAvailable boolean
$delayWhileIdle boolean
$dryRun boolean
$priority string
$restrictedPackageName string
$timeToLive string

Public Methods

Method Description
build ( ) : Options build an instance of Options
getCollapseKey ( ) : null | string Get the collapseKey
getPriority ( ) : null | string Get the priority
getRestrictedPackageName ( ) : null | string get restricted package name
getTimeToLive ( ) : null | integer get time to live
isContentAvailable ( ) : boolean is content available
isDelayWhileIdle ( ) : boolean is delay white idle
isDryRun ( ) : boolean is dry run
setCollapseKey ( String $collapseKey ) : OptionsBuilder This parameter identifies a group of messages A maximum of 4 different collapse keys is allowed at any given time.
setContentAvailable ( boolean $contentAvailable ) : OptionsBuilder support only Android and Ios
setDelayWhileIdle ( boolean $delayWhileIdle ) : OptionsBuilder When this parameter is set to true, it indicates that the message should not be sent until the device becomes active.
setDryRun ( boolean $isDryRun ) : OptionsBuilder This parameter, when set to true, allows developers to test a request without actually sending a message.
setPriority ( String $priority ) : OptionsBuilder Sets the priority of the message. Valid values are "normal" and "high." By default, messages are sent with normal priority
setRestrictedPackageName ( string $restrictedPackageName ) : OptionsBuilder This parameter specifies the package name of the application where the registration tokens must match in order to receive the message.
setTimeToLive ( integer $timeToLive ) : OptionsBuilder This parameter specifies how long the message should be kept in FCM storage if the device is offline

Method Details

build() public method

build an instance of Options
public build ( ) : Options
return Options

getCollapseKey() public method

Get the collapseKey
public getCollapseKey ( ) : null | string
return null | string

getPriority() public method

Get the priority
public getPriority ( ) : null | string
return null | string

getRestrictedPackageName() public method

get restricted package name
public getRestrictedPackageName ( ) : null | string
return null | string

getTimeToLive() public method

get time to live
public getTimeToLive ( ) : null | integer
return null | integer

isContentAvailable() public method

is content available
public isContentAvailable ( ) : boolean
return boolean

isDelayWhileIdle() public method

is delay white idle
public isDelayWhileIdle ( ) : boolean
return boolean

isDryRun() public method

is dry run
public isDryRun ( ) : boolean
return boolean

setCollapseKey() public method

This parameter identifies a group of messages A maximum of 4 different collapse keys is allowed at any given time.
public setCollapseKey ( String $collapseKey ) : OptionsBuilder
$collapseKey String
return OptionsBuilder

setContentAvailable() public method

An inactive client app is awoken. On iOS, use this field to represent content-available in the APNS payload. On Android, data messages wake the app by default. On Chrome, currently not supported.
public setContentAvailable ( boolean $contentAvailable ) : OptionsBuilder
$contentAvailable boolean
return OptionsBuilder

setDelayWhileIdle() public method

When this parameter is set to true, it indicates that the message should not be sent until the device becomes active.
public setDelayWhileIdle ( boolean $delayWhileIdle ) : OptionsBuilder
$delayWhileIdle boolean
return OptionsBuilder

setDryRun() public method

It should only be used for the development
public setDryRun ( boolean $isDryRun ) : OptionsBuilder
$isDryRun boolean
return OptionsBuilder

setPriority() public method

Sets the priority of the message. Valid values are "normal" and "high." By default, messages are sent with normal priority
public setPriority ( String $priority ) : OptionsBuilder
$priority String
return OptionsBuilder

setRestrictedPackageName() public method

This parameter specifies the package name of the application where the registration tokens must match in order to receive the message.
public setRestrictedPackageName ( string $restrictedPackageName ) : OptionsBuilder
$restrictedPackageName string
return OptionsBuilder

setTimeToLive() public method

This parameter specifies how long the message should be kept in FCM storage if the device is offline
public setTimeToLive ( integer $timeToLive ) : OptionsBuilder
$timeToLive integer (in second) min:0 max:2419200
return OptionsBuilder

Property Details

$collapseKey protected_oe property

protected string $collapseKey
return string

$contentAvailable protected_oe property

protected bool $contentAvailable
return boolean

$delayWhileIdle protected_oe property

protected bool $delayWhileIdle
return boolean

$dryRun protected_oe property

protected bool $dryRun
return boolean

$priority protected_oe property

protected string $priority
return string

$restrictedPackageName protected_oe property

protected string $restrictedPackageName
return string

$timeToLive protected_oe property

protected string $timeToLive
return string