PHPackages                             strivekp/phpfcmsb - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. strivekp/phpfcmsb

ActiveLibrary[HTTP &amp; Networking](/categories/http)

strivekp/phpfcmsb
=================

PHP Implementation of FCM HTTP v1 API updte to use guzzle 7

v1.0.2(6y ago)0237↓50%1MITPHPPHP &gt;=5.6

Since May 22Pushed 4y agoCompare

[ Source](https://github.com/kuntal-sb/php-fcm-v1)[ Packagist](https://packagist.org/packages/strivekp/phpfcmsb)[ Docs](https://github.com/lkaybob/phpFCMv1)[ RSS](/packages/strivekp-phpfcmsb/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (6)Used By (1)

phpfcmsb
========

[](#phpfcmsb)

[![Build Status](https://camo.githubusercontent.com/da0cdd75d6378cf0a4858e63c8f2949e1c812a45726c9d8d47dcebc76524a0a5/68747470733a2f2f7472617669732d63692e6f72672f7374726976656b702f70687066636d73622e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/strivekp/phpfcmsb)[![codecov](https://camo.githubusercontent.com/e3ae3b3ae9e8f158b209ca01aca4e2d49db870b3a7705c5d7ca817c63e909111/68747470733a2f2f636f6465636f762e696f2f67682f7374726976656b702f70687066636d73622f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/strivekp/phpfcmsb)[![Latest Stable Version](https://camo.githubusercontent.com/931277a0d42c6d2223ecc2f5910420d3a6e9781944966671afc2d7894233d3b0/68747470733a2f2f706f7365722e707567782e6f72672f7374726976656b702f70687066636d73622f762f737461626c65)](https://packagist.org/packages/strivekp/phpfcmsb)[![Total Downloads](https://camo.githubusercontent.com/91ac3ed32322542c04840ba20a59b293040fafdd9781429045867bd6c86067a8/68747470733a2f2f706f7365722e707567782e6f72672f7374726976656b702f70687066636d73622f646f776e6c6f616473)](https://packagist.org/packages/strivekp/phpfcmsb)[![License](https://camo.githubusercontent.com/81f403aa3295eabe66501040910b16ce99baeb63f94a0ee79088e1948241b5f1/68747470733a2f2f706f7365722e707567782e6f72672f7374726976656b702f70687066636d73622f6c6963656e7365)](https://packagist.org/packages/strivekp/phpfcmsb)

phpfcmsb is an PHP implementation of [FCM](https://firebase.google.com/docs/cloud-messaging) HTTP v1 API

### What is different compared to others FCM Libraries?

[](#what-is-different-compared-to-others-fcm-libraries)

Most of other libraries are implementation of FCM's [Legacy HTTP Server Protocol](https://firebase.google.com/docs/cloud-messaging/http-server-ref). It requires a server key from Firebase console (which means you have to copy and paste in your code) ([Docs](https://firebase.google.com/docs/cloud-messaging/auth-server#authorize_legacy_protocol_send_requests))

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](https://firebase.googleblog.com/2017/11/whats-new-with-fcm-customizing-messages.html) about HTTP v1 API)

### References

[](#references)

- [google/node-gtoken](https://github.com/google/node-gtoken)
- [google/google-auth-library-nodejs](https://github.com/google/google-auth-library-nodejs): Above two libraries let me understand how HTTP v1 API works in FCM
- [guzzlehttp/guzzle](https://github.com/guzzle/guzzle) : GuzzleHttp let this library to PSR7 compatible
- [Paragraph1/php-fcm](https://github.com/Paragraph1/php-fcm) : Inspired me how FCM libraries are used in Legacy HTTP Protocol

### How to use

[](#how-to-use)

- Install the library with composer

    ```
    composer require strivekp/phpfcmsb

    ```

---

- Import the library with *autoload.php*

    ```
