Skip to content

symfony/firebase-notifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Sep 27, 2024
b993cef · Sep 27, 2024
Sep 25, 2024
Sep 9, 2021
Sep 23, 2024
Jul 6, 2024
Apr 3, 2021
Feb 11, 2021
Jul 23, 2024
Jun 20, 2024
Jun 20, 2024
Jan 24, 2023
Apr 8, 2023
Sep 23, 2024
Jun 2, 2021

Repository files navigation

Firebase Notifier

Provides Firebase integration for Symfony Notifier.

DSN example

FIREBASE_DSN=firebase://USERNAME:PASSWORD@default

where:

  • USERNAME is your Firebase username
  • PASSWORD is your Firebase password

Adding Interactions to a Message

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);

Resources