Download the PHP package trantuanson1991/php-fcm-v1 without Composer
On this page you can find all versions of the php package trantuanson1991/php-fcm-v1. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download trantuanson1991/php-fcm-v1
More information about trantuanson1991/php-fcm-v1
Files in trantuanson1991/php-fcm-v1
Package php-fcm-v1
Short Description PHP Implementation of FCM HTTP v1 API. Fork from lkaybob/php-fcm-v1 and change Firebase JWT, Guzzle version
License MIT
Homepage https://github.com/lkaybob/phpFCMv1
Informations about the package php-fcm-v1
php-fcm-v1
php-fcm-v1 is an PHP implementation of FCM HTTP v1 API
What is different compared to others FCM Libraries?
Most of other libraries are implementation of FCM's Legacy HTTP Server Protocol. It requires a server key from Firebase console (which means you have to copy and paste in your code) (Docs)
HTTP v1 API, in contrast, leverages OAuth2 security model. You need to get an access token (which is valid for about an hour) in order to request sending notification with service account's private key file. Although (See the blog post about HTTP v1 API)
References
- google/node-gtoken
- google/google-auth-library-nodejs : Above two libraries let me understand how HTTP v1 API works in FCM
- guzzlehttp/guzzle : GuzzleHttp let this library to PSR7 compatible
- Paragraph1/php-fcm : Inspired me how FCM libraries are used in Legacy HTTP Protocol
How to use
- Install the library with composer
-
Import the library with autoload.php
-
Create Necessary class instances, Client, Recipient, Notification/Data
-
Setup each instances with necessary information
- Fire in the FCM Server!
Further Example
-
Full Simple Example
-
Using with PRIOIRTY option (for both Android & iOS)
- For independent platform (either Android or iOS)
Future Works
- [ ] Implement simultaneous send (Currently supports single recipient or topic one at a time)
- [ ] Setup Read the Docs
- [x] Add CI Test
- [x] Add CodeCov Badge