PHP Classes

PHP Send Push Notification to Android (FCM): Notify users of Google Firebase Cloud Messaging

Recommend this page to a friend!
  Info   View files Documentation   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 50%Total: 599 This week: 1All time: 5,196 This week: 560Up
Version License PHP version Categories
sendnotif 0.1Custom (specified...5PHP 5, Web services, Chat
Description 

Author

This class can notify users of Google Firebase Cloud Messaging (FCM).

It can take an array of identifiers of Android devices and sends a push notification to all of them by sending a HTTP request to the API of FCM.

The request passes parameters that defines message the title, sub-title, ticket text, and whether the device should vibrate or sound.

Innovation Award
PHP Programming Innovation award nominee
March 2018
Number 9
When applications need to send push notifications to Android devices, they can use Google APIs for that purpose.

Previously Google provided the Cloud Messaging API. Now developers can use the Firebase Messaging API for the same purpose. This class is able to use that API to send push notifications to Android device users.

Manuel Lemos
Picture of Pavitra Behre
Name: Pavitra Behre <contact>
Classes: 1 package by
Country: India India
Age: ???
All time rank: 3053193 in India India
Week rank: 416 Up25 in India India Up
Innovation award
Innovation award
Nominee: 1x

Documentation

sendNotif

A php wrapper to send push notifications using Google's FCM

Usage

include('sendNotif.php');
$push = new sendNotif();
$push->set_api_key('API_KEY');
$push->set_rid($rids); //Where $rid is an array of registration ids, atleast one is required
$push->set_msg($title, $msg, $subtitle = null, $ticketText = null, $vibrate = true, $sound = 1);
//You can also use a message array, check the code or FCM documention for the array format
$push->set_msg_arr($array);

$response = $push->send();


  Files folder image Files  
File Role Description
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Documentation
Plain text file sendNotif.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:599
This week:1
All time:5,196
This week:560Up
 User Ratings  
 
 All time
Utility:75%StarStarStarStar
Consistency:75%StarStarStarStar
Documentation:58%StarStarStar
Examples:-
Tests:-
Videos:-
Overall:50%StarStarStar
Rank:2583