Class DownstreamResponse
- Class name: DownstreamResponse
- Namespace: LaravelFCM\Response
- Parent class: LaravelFCM\Response\BaseResponse
- This class implements: LaravelFCM\Response\DownstreamResponseContract
const MULTICAST_ID = 'multicast_id'
const CANONICAL_IDS = "canonical_ids"
const RESULTS = "results"
const MISSING_REGISTRATION = "MissingRegistration"
const MESSAGE_ID = "message_id"
const REGISTRATION_ID = "registration_id"
const NOT_REGISTERED = "NotRegistered"
const INVALID_REGISTRATION = "InvalidRegistration"
const UNAVAILABLE = "Unavailable"
const DEVICE_MESSAGE_RATE_EXCEEDED = "DeviceMessageRateExceeded"
const INTERNAL_SERVER_ERROR = "InternalServerError"
const SUCCESS = 'success'
const FAILURE = 'failure'
const ERROR = "error"
mixed LaravelFCM\Response\BaseResponse::__construct(\GuzzleHttp\Psr7\Response $response)
BaseResponse constructor.
- Visibility: public
- This method is defined by LaravelFCM\Response\BaseResponse
- $response GuzzleHttp\Psr7\Response
mixed LaravelFCM\Response\BaseResponse::parseResponse(array $responseInJson)
parse the response
- Visibility: protected
- This method is abstract.
- This method is defined by LaravelFCM\Response\BaseResponse
- $responseInJson array
mixed LaravelFCM\Response\DownstreamResponseContract::merge(\LaravelFCM\Response\DownstreamResponse $response)
Merge two response
- Visibility: public
- This method is defined by LaravelFCM\Response\DownstreamResponseContract
- $response LaravelFCM\Response\DownstreamResponse
integer LaravelFCM\Response\DownstreamResponseContract::numberSuccess()
Get the number of device reached with success
- Visibility: public
- This method is defined by LaravelFCM\Response\DownstreamResponseContract
integer LaravelFCM\Response\DownstreamResponseContract::numberFailure()
Get the number of device which thrown an error
- Visibility: public
- This method is defined by LaravelFCM\Response\DownstreamResponseContract
integer LaravelFCM\Response\DownstreamResponseContract::numberModification()
Get the number of device that you need to modify their token
- Visibility: public
- This method is defined by LaravelFCM\Response\DownstreamResponseContract
array LaravelFCM\Response\DownstreamResponseContract::tokensToDelete()
get token to delete
remove all tokens returned by this method in your database
- Visibility: public
- This method is defined by LaravelFCM\Response\DownstreamResponseContract
array LaravelFCM\Response\DownstreamResponseContract::tokensToModify()
get token to modify
key: oldToken value: new token
find the old token in your database and replace it with the new one
- Visibility: public
- This method is defined by LaravelFCM\Response\DownstreamResponseContract
array LaravelFCM\Response\DownstreamResponseContract::tokensToRetry()
Get tokens that you should resend using exponential backoof
- Visibility: public
- This method is defined by LaravelFCM\Response\DownstreamResponseContract
array LaravelFCM\Response\DownstreamResponseContract::tokensWithError()
Get tokens that thrown an error
key : token value : error
In production, remove these tokens from you database
- Visibility: public
- This method is defined by LaravelFCM\Response\DownstreamResponseContract
boolean LaravelFCM\Response\DownstreamResponseContract::hasMissingToken()
check if missing tokens was given to the request If true, remove all the empty token in your database
- Visibility: public
- This method is defined by LaravelFCM\Response\DownstreamResponseContract
mixed LaravelFCM\Response\BaseResponse::isJsonResponse(\GuzzleHttp\Psr7\Response $response)
Check if the response given by fcm is parsable
- Visibility: private
- This method is defined by LaravelFCM\Response\BaseResponse
- $response GuzzleHttp\Psr7\Response
mixed LaravelFCM\Response\BaseResponse::logResponse()
Log the response
- Visibility: protected
- This method is abstract.
- This method is defined by LaravelFCM\Response\BaseResponse