kreit cloud messaging with token array php

Solutions on MaxInterview for kreit cloud messaging with token array php by the best coders in the world

showing results for - "kreit cloud messaging with token array php"
Paulina
21 Nov 2019
1use Kreait\Firebase\Messaging\CloudMessage;
2
3$topic = 'a-topic';
4
5$message = CloudMessage::withTarget('topic', $topic)
6    ->withNotification($notification) // optional
7    ->withData($data) // optional
8;
9
10$message = CloudMessage::fromArray([
11    'topic' => $topic,
12    'notification' => [/* Notification data as array */], // optional
13    'data' => [/* data array */], // optional
14]);
15
16$messaging->send($message);