1. Go to this page and download the library: Download autoxloo/fcm 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/ */
autoxloo / fcm example snippets
composer
$projectId = 'autoxloo'; // id of your project created in firebase console
$serviceAccountFilePath = __DIR__ . '/service_account.json'; // path to your generated private key file for your service account
$fcm = new FirebaseCloudMessaging($projectId, $serviceAccountFilePath);
$response = $fcm->send($message); // $message is instance of \autoxloo\fcm\message\Message
// $response is instance of \GuzzleHttp\Psr7\Response