PHP code example of symfony / firebase-notifier

1. Go to this page and download the library: Download symfony/firebase-notifier library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

symfony / firebase-notifier example snippets


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