Skip to content

Instantly share code, notes, and snippets.

View ProdigyTech's full-sized avatar

Javar Alexander ProdigyTech

View GitHub Profile
@ProdigyTech
ProdigyTech / PushNotifications.php
Last active April 2, 2017 17:16
Simple PHP script to send an Android Device push notifications using Firebase Cloud Messaging API
class PushNotifications{
private static $API_ACCESS_KEY = "YOUR_FCM_SERVER_KEY ";
public function __construct() {
// exit('Init function is not allowed');
}
public function android($data, $reg_id) {
$url = 'https://fcm.googleapis.com/fcm/send';
$message = array
(
'title' => $data['mtitle'],