PHP Interface LaravelFCM\Response\DownstreamResponseContract

Show file Open project: brozot/laravel-fcm

Public Methods

Method Description
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

Method Details

hasMissingToken() public method

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

merge() public method

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

numberFailure() public method

Get the number of device which thrown an error
public numberFailure ( ) : integer
return integer

numberModification() public method

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

numberSuccess() public method

Get the number of device reached with success
public numberSuccess ( ) : integer
return integer

tokensToDelete() public method

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

tokensToModify() public method

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

tokensToRetry() public method

Get tokens that you should resend using exponential backoof
public tokensToRetry ( ) : array
return array

tokensWithError() public method

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