Documentation

SendAllResult
in package

A result for multiple messages. For example used when sending multiple messages to multiple devices.

Table of Contents

Properties

$errors  : array<string|int, mixed>
$sent  : array<string|int, mixed>
$unregistered  : array<string|int, mixed>

Methods

__construct()  : mixed
addToErrors()  : void
Add a message that resulted in an error to the result.
addToSent()  : void
Add a successfully sent message to the result.
addToUnregistered()  : void
Add an unregistered message to the result.
getErrors()  : array<int, FcmError>
Get the messages with errors.
getSent()  : array<int, string>
Get the sent message and Firebase Ids.
getUnregistered()  : array<int, FcmError>
Get the messages with unregistered tokens.

Properties

$unregistered

private array<string|int, mixed> $unregistered = []

Methods

__construct()

public __construct([array<int, string> $sent = [] ][, array<int, FcmError$unregistered = [] ][, array<int, FcmError$errors = [] ]) : mixed
Parameters
$sent : array<int, string> = []

Successfully sent messages where key = message ID and value = Firebase message ID.

$unregistered : array<int, FcmError> = []

Messages that were sent to tokens that have been unregistered and can therefore be safely removed. The key is the message ID and the value is a FcmError.

$errors : array<int, FcmError> = []

Messages that resulted in errors. The key is the message ID and the value is a FcmError.

addToErrors()

Add a message that resulted in an error to the result.

public addToErrors(int $messageId, FcmError $fcmError) : void
Parameters
$messageId : int
$fcmError : FcmError

addToSent()

Add a successfully sent message to the result.

public addToSent(int $messageId, string $firebaseId) : void
Parameters
$messageId : int
$firebaseId : string

addToUnregistered()

Add an unregistered message to the result.

public addToUnregistered(int $messageId, FcmError $fcmError) : void
Parameters
$messageId : int
$fcmError : FcmError

getErrors()

Get the messages with errors.

public getErrors() : array<int, FcmError>
Return values
array<int, FcmError>

An array where the key is the message ID and the value a FcmError.

getSent()

Get the sent message and Firebase Ids.

public getSent() : array<int, string>
Return values
array<int, string>

An array where the key is the message ID and the value the Firebase ID.

getUnregistered()

Get the messages with unregistered tokens.

public getUnregistered() : array<int, FcmError>
Return values
array<int, FcmError>

An array where the key is the message ID and the value a FcmError.


        
On this page

Search results