Provides Firebase integration for Symfony Notifier.
FIREBASE_DSN=firebase://USERNAME:PASSWORD@default
where:
USERNAME
is your Firebase usernamePASSWORD
is your Firebase password
With a Firebase message, you can use the AndroidNotification
, IOSNotification
or WebNotification
classes to add
message options.
use Symfony\Component\Notifier\Message\ChatMessage;
use Symfony\Component\Notifier\Bridge\Firebase\Notification\AndroidNotification;
$chatMessage = new ChatMessage('');
// Create AndroidNotification options
$androidOptions = (new AndroidNotification('/topics/news', []))
->icon('myicon')
->sound('default')
->tag('myNotificationId')
->color('#cccccc')
->clickAction('OPEN_ACTIVITY_1')
// ...
;
// Add the custom options to the chat message and send the message
$chatMessage->options($androidOptions);
$chatter->send($chatMessage);