Topic Response¶
Introduction¶
To get the response of a topic request, just save the return of the sendToTopic() method into a variable.
$response = $fcm->sendToTopic($topic);
You have three methods available to read downstream response:
isSuccess(): Returntrueif topic was sent with success.
$response->isSuccess();
shouldRetry(): Returntrueif topic must be resent.
$response->shouldRetry();
getError(): Return the error message if topic couldn’t be sent.
$response->getError();
For more details on topic response, refer to the FCM documentation