Answers for "kreit cloud messaging with token array php"

PHP
0

kreit cloud messaging with token array php

use Kreait\Firebase\Messaging\CloudMessage;

$topic = 'a-topic';

$message = CloudMessage::withTarget('topic', $topic)
    ->withNotification($notification) // optional
    ->withData($data) // optional
;

$message = CloudMessage::fromArray([
    'topic' => $topic,
    'notification' => [/* Notification data as array */], // optional
    'data' => [/* data array */], // optional
]);

$messaging->send($message);
Posted by: Guest on November-18-2020

Browse Popular Code Answers by Language