Basic class to send push notifications using google firebase.
Be careful! This library needs curl module for php to work.
FMC Push Notifications is hosted in packagist so you can get it from Composer
composer require legomolina/fcm-push-notification
Require the Composer autoload in your index:
<?php
require 'vendor/autoload.php';
Set your Firebase API key
FCMPushNotifications::API_KEY = "my_api_key";
Create a notification object:
$notification = new FCMNotification("Title", "Message");
And send notifications
FCMPushNotifications::send("mobile_token_or_topic", $notification, [ "custom" => "data" ]);
FMC Push Notifications is licensed under the GPL v3 license. See License File for more information.