Skip to content

why-absystem/gfcm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

GFCM

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

About

Google Firebase Cloud Messaging

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages