1. Go to this page and download the library: Download elmogy/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/ */
elmogy / fcm example snippets
use elmogy\fcm\FCMService;
$fcmService = new FCMService();
use elmogy\fcm\FCMService;
$fcmService = new FCMService();
$fcmToken = "DEVICE_TOKEN"; // Replace with the actual FCM token
$title = "Test Notification";
$body = "This is a test message.";
$icon = "/default.png"; // Optional
$data = ['key' => 'value'] ; // Optional
$response = $fcmService->sendFCM($fcmToken, $title, $body , $icon ,$data);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.