absystem / gfcm
PHP Google Cloud Messaging (GCM) Library
Installs: 9
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/absystem/gfcm
Requires
- guzzlehttp/guzzle: ~6.0
This package is auto-updated.
Last update: 2025-09-09 05:33:55 UTC
README
Google Firebase Cloud Messaging with PHP
INSTALLATION 🔥
composer require absystem/gfcm
REQUIREMENTS ⚠️
▪️ PHP >=5.6.
▪️ Composer.
▪️ Guzzle v6.x sudah include di package.
SETTING CONFIG 🌐
$config = [ 'server_key' => '', // kunci server dari google console 'base_url' => 'https://fcm.googleapis.com/fcm/send' ]; //array token device $tokendevice = [];
CONTOH PENGGUNAAN 💻
require_once __DIR__ . '/vendor/autoload.php'; use ABSystem\Google\FCM; $fcm = new FCM($config); $fcm->setTokenDevice($tokendevice); $fcm->setDataPayload([ 'koordinat' => [ 'lat' => '', 'lng' => '', ], 'link' => [ 'page'=> '/map.html' ], ]); $fcm->setPesan('Judul Notifikasi', 'Isi pesan yang tampil.'); $fcm->kirim();