PHP Class LaravelFCM\Response\DownstreamResponse

Inheritance: extends BaseResponse, implements LaravelFCM\Response\DownstreamResponseContract
Afficher le fichier Open project: brozot/laravel-fcm Class Usage Examples

Protected Properties

Свойство Type Description
$hasMissingToken boolean
$messageId
$numberTokenModify integer
$numberTokensFailure integer
$numberTokensSuccess integer
$tokensToDelete array
$tokensToModify array
$tokensToRetry array
$tokensWithError array

Méthodes publiques

Méthode Description
__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

Méthodes protégées

Méthode Description
logResponse ( )
parseResponse ( $responseInJson ) Parse the response

Private Methods

Méthode Description
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 )

Method Details

__construct() public méthode

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

hasMissingToken() public méthode

check if missing tokens was given to the request If true, remove all the empty token in your database
public hasMissingToken ( ) : boolean
Résultat boolean

logResponse() protected méthode

protected logResponse ( )

merge() public méthode

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

numberFailure() public méthode

Get the number of device which thrown an error
public numberFailure ( ) : integer
Résultat integer

numberModification() public méthode

Get the number of device that you need to modify their token
public numberModification ( ) : integer
Résultat integer

numberSuccess() public méthode

Get the number of device reached with success
public numberSuccess ( ) : integer
Résultat integer

parseResponse() protected méthode

Parse the response
protected parseResponse ( $responseInJson )
$responseInJson

tokensToDelete() public méthode

remove all tokens returned by this method in your database
public tokensToDelete ( ) : array
Résultat array

tokensToModify() public méthode

key: oldToken value: new token find the old token in your database and replace it with the new one
public tokensToModify ( ) : array
Résultat array

tokensToRetry() public méthode

Get tokens that you should resend using exponential backoof
public tokensToRetry ( ) : array
Résultat array

tokensWithError() public méthode

key : token value : error In production, remove these tokens from you database
public tokensWithError ( ) : array
Résultat array

Property Details

$hasMissingToken protected_oe property

protected bool $hasMissingToken
Résultat boolean

$messageId protected_oe property

protected $messageId

$numberTokenModify protected_oe property

protected int $numberTokenModify
Résultat integer

$numberTokensFailure protected_oe property

protected int $numberTokensFailure
Résultat integer

$numberTokensSuccess protected_oe property

protected int $numberTokensSuccess
Résultat integer

$tokensToDelete protected_oe property

protected array $tokensToDelete
Résultat array

$tokensToModify protected_oe property

protected array $tokensToModify
Résultat array

$tokensToRetry protected_oe property

protected array $tokensToRetry
Résultat array

$tokensWithError protected_oe property

protected array $tokensWithError
Résultat array