PHP Класс LaravelFCM\Response\DownstreamResponse

Наследование: extends BaseResponse, implements LaravelFCM\Response\DownstreamResponseContract
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$hasMissingToken boolean
$messageId
$numberTokenModify integer
$numberTokensFailure integer
$numberTokensSuccess integer
$tokensToDelete array
$tokensToModify array
$tokensToRetry array
$tokensWithError array

Открытые методы

Метод Описание
__construct ( Response $response, $tokens ) DownstreamResponse constructor.
hasMissingToken ( ) : boolean check if missing tokens was given to the request If true, remove all the empty token in your database
merge ( DownstreamResponse $response ) Merge two response
numberFailure ( ) : integer Get the number of device which thrown an error
numberModification ( ) : integer Get the number of device that you need to modify their token
numberSuccess ( ) : integer Get the number of device reached with success
tokensToDelete ( ) : array get token to delete
tokensToModify ( ) : array get token to modify
tokensToRetry ( ) : array Get tokens that you should resend using exponential backoof
tokensWithError ( ) : array Get tokens that thrown an error

Защищенные методы

Метод Описание
logResponse ( )
parseResponse ( $responseInJson ) Parse the response

Приватные методы

Метод Описание
checkMissingToken ( $result ) : boolean
isSent ( $results ) : boolean
needResultParsing ( $responseInJson ) : boolean
needToAddError ( $index, $result )
needToBeDeleted ( $index, $result ) : boolean
needToBeModify ( $index, $result ) : boolean
needToResend ( $index, $result ) : boolean
parse ( $responseInJson )
parseResult ( $responseInJson )

Описание методов

__construct() публичный Метод

DownstreamResponse constructor.
public __construct ( Response $response, $tokens )
$response GuzzleHttp\Psr7\Response
$tokens

hasMissingToken() публичный Метод

check if missing tokens was given to the request If true, remove all the empty token in your database
public hasMissingToken ( ) : boolean
Результат boolean

logResponse() защищенный Метод

protected logResponse ( )

merge() публичный Метод

Merge two response
public merge ( DownstreamResponse $response )
$response DownstreamResponse

numberFailure() публичный Метод

Get the number of device which thrown an error
public numberFailure ( ) : integer
Результат integer

numberModification() публичный Метод

Get the number of device that you need to modify their token
public numberModification ( ) : integer
Результат integer

numberSuccess() публичный Метод

Get the number of device reached with success
public numberSuccess ( ) : integer
Результат integer

parseResponse() защищенный Метод

Parse the response
protected parseResponse ( $responseInJson )
$responseInJson

tokensToDelete() публичный Метод

remove all tokens returned by this method in your database
public tokensToDelete ( ) : array
Результат array

tokensToModify() публичный Метод

key: oldToken value: new token find the old token in your database and replace it with the new one
public tokensToModify ( ) : array
Результат array

tokensToRetry() публичный Метод

Get tokens that you should resend using exponential backoof
public tokensToRetry ( ) : array
Результат array

tokensWithError() публичный Метод

key : token value : error In production, remove these tokens from you database
public tokensWithError ( ) : array
Результат array

Описание свойств

$hasMissingToken защищенное свойство

protected bool $hasMissingToken
Результат boolean

$messageId защищенное свойство

protected $messageId

$numberTokenModify защищенное свойство

protected int $numberTokenModify
Результат integer

$numberTokensFailure защищенное свойство

protected int $numberTokensFailure
Результат integer

$numberTokensSuccess защищенное свойство

protected int $numberTokensSuccess
Результат integer

$tokensToDelete защищенное свойство

protected array $tokensToDelete
Результат array

$tokensToModify защищенное свойство

protected array $tokensToModify
Результат array

$tokensToRetry защищенное свойство

protected array $tokensToRetry
Результат array

$tokensWithError защищенное свойство

protected array $tokensWithError
Результат array