PHP Class LaravelFCM\Response\TopicResponse

Inheritance: extends BaseResponse, implements LaravelFCM\Response\TopicResponseContract
Show file Open project: brozot/laravel-fcm Class Usage Examples

Protected Properties

Property Type Description
$error string
$messageId string
$needRetry boolean
$topic string

Public Methods

Method Description
__construct ( Response $response, Topics $topic ) TopicResponse constructor.
error ( ) : string return error message you should test if it's necessary to resent it
isSuccess ( ) : boolean true if topic sent with success
shouldRetry ( ) : boolean return true if it's necessary resent it using exponential backoff

Protected Methods

Method Description
logResponse ( ) Log the response
parseResponse ( $responseInJson ) parse the response

Private Methods

Method Description
parseError ( $responseInJson )
parseSuccess ( $responseInJson )

Method Details

__construct() public method

TopicResponse constructor.
public __construct ( Response $response, Topics $topic )
$response GuzzleHttp\Psr7\Response
$topic LaravelFCM\Message\Topics

error() public method

return error message you should test if it's necessary to resent it
public error ( ) : string
return string error

isSuccess() public method

true if topic sent with success
public isSuccess ( ) : boolean
return boolean

logResponse() protected method

Log the response
protected logResponse ( )

parseResponse() protected method

parse the response
protected parseResponse ( $responseInJson )
$responseInJson

shouldRetry() public method

return true if it's necessary resent it using exponential backoff
public shouldRetry ( ) : boolean
return boolean

Property Details

$error protected property

protected string $error
return string

$messageId protected property

protected string $messageId
return string

$needRetry protected property

protected bool $needRetry
return boolean

$topic protected property

protected string $topic
return string