This repository showcases a simple and effective script to send push notifications to Android devices using Firebase Cloud Messaging (FCM). Designed for developers, the code provides a quick setup for integrating FCM notifications with minimal configuration.
- Lightweight PHP implementation.
- Customizable notification content, including title, body, and icons.
- Detailed documentation for ease of use.
- Replace
YOUR-SERVER-API-ACCESS-KEY
with your FCM server key from the Google API Console. - Pass the device's registration ID via a GET request to the script.
- Execute the script to deliver the notification.
http://yourdomain.com/PhpFireBaseNotificationSample.php?id=DEVICE_REGISTRATION_ID
I created a fork available here
What's the difference from the original script ?
-You can send message to a specific device by informing a device ID to the parameter 'id'
-or send a broadcast to a specific topic to the parameter 'topic'.
-it is necessary to set a specific topic previously on your Firebase Console and
also the device must subscribe to it.
-You will also receive a error message if you do not pass any value to those two needed parameters.