PHPackages                             enjoy-it/php-fcm - 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. [Mail &amp; Notifications](/categories/mail)
4. /
5. enjoy-it/php-fcm

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

enjoy-it/php-fcm
================

PHP application server for google firebase cloud messaging (FCM)

v1.1.2(4y ago)010MITPHPPHP &gt;=5.5

Since Nov 29Pushed 4y ago1 watchersCompare

[ Source](https://github.com/enjoy-it/php-fcm)[ Packagist](https://packagist.org/packages/enjoy-it/php-fcm)[ Docs](https://github.com/enjoy-it/phpFCM)[ RSS](/packages/enjoy-it-php-fcm/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (4)Versions (5)Used By (0)

phpFCM
======

[](#phpfcm)

PHP application server implementation for Firebase Cloud Messaging.

- supports device and topic messages
- currently this app server library only supports sending Messages/Notifications via HTTP.
- thanks to guzzle our library answers in PSR7 compatible response objects
- see the full docs on firebase cloud messaging here :
- Firebase Cloud Messaging HTTP Protocol:  for in-depth description

\#Setup The recommended way of installing is using Composer.

command line

```
composer require paragraph1/php-fcm

```

composer.json

```
"require": {
    "paragraph1/php-fcm": "*"
}

```

\#Send to Device also see

```
use paragraph1\phpFCM\Client;
use paragraph1\phpFCM\Message;
use paragraph1\phpFCM\Recipient\Device;
use paragraph1\phpFCM\Notification;

require_once 'vendor/autoload.php';

$apiKey = 'YOUR SERVER KEY';
$client = new Client();
$client->setApiKey($apiKey);
$client->injectHttpClient(new \GuzzleHttp\Client());

$note = new Notification('test title', 'testing body');
$note->setIcon('notification_icon_resource_name')
    ->setColor('#ffffff')
    ->setBadge(1);

$message = new Message();
$message->addRecipient(new Device('your-device-token'));
$message->setNotification($note)
    ->setData(array('someId' => 111));

$response = $client->send($message);
var_dump($response->getStatusCode());
```

\#Send to topic also see

```
use paragraph1\phpFCM\Client;
use paragraph1\phpFCM\Message;
use paragraph1\phpFCM\Recipient\Topic;
use paragraph1\phpFCM\Notification;

require_once 'vendor/autoload.php';

$apiKey = 'YOUR SERVER KEY';
$client = new Client();
$client->setApiKey($apiKey);
$client->injectHttpClient(new \GuzzleHttp\Client());

$message = new Message();
$message->addRecipient(new Topic('your-topic'));
//select devices where has 'your-topic1' && 'your-topic2' topics
$message->addRecipient(new Topic(['your-topic1', 'your-topic2']));
$message->setNotification(new Notification('test title', 'testing body'))
    ->setData(array('someId' => 111));

$response = $client->send($message);
var_dump($response->getStatusCode());
```

\#Subscribe device to the topic

```
use paragraph1\phpFCM\Client;

$apiKey = '_YOUR_SERVER_KEY_';
$client = new Client();
$client->setApiKey($apiKey);

$response = $client->addTopicSubscription('_SOME_TOPIC_ID_', ['_FIRST_TOKEN_', '_SECOND_TOKEN_']);
var_dump($response->getStatusCode());
var_dump($response->getBody()->getContents());
```

\#Remove device to the topic

```
use paragraph1\phpFCM\Client;

$apiKey = '_YOUR_SERVER_KEY_';
$client = new Client();
$client->setApiKey($apiKey);

$response = $client->removeTopicSubscription('_SOME_TOPIC_ID_', ['_FIRST_TOKEN_', '_SECOND_TOKEN_']);
var_dump($response->getStatusCode());
var_dump($response->getBody()->getContents());
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~5 days

Total

4

Last Release

1610d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ca953563d6af17871f53731157697a4f6843d3b54bfadaa2fa788d9fc1c08265?d=identicon)[enjoy-it](/maintainers/enjoy-it)

---

Tags

phpgooglenotificationsgcmfirebaseFCMandroidiosFirebase Cloud Messaging

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/enjoy-it-php-fcm/health.svg)

```
[![Health](https://phpackages.com/badges/enjoy-it-php-fcm/health.svg)](https://phpackages.com/packages/enjoy-it-php-fcm)
```

###  Alternatives

[paragraph1/php-fcm

PHP application server for google firebase cloud messaging (FCM)

1991.2M10](/packages/paragraph1-php-fcm)[kedniko/firebase-cloud-messaging-http-v1-php

Firebase cloud messaging http v1 php

124.8k](/packages/kedniko-firebase-cloud-messaging-http-v1-php)[redjanym/php-firebase-cloud-messaging

PHP SDK for Firebase Cloud Messaging from Google

39847.9k1](/packages/redjanym-php-firebase-cloud-messaging)[redjanym/fcm-bundle

A Symfony Bundle for projects to send notifications in mobile devices through Firebase Cloud Messaging HTTP V1 API

43453.0k](/packages/redjanym-fcm-bundle)[edwinhoksberg/php-fcm

A library for sending Firebase cloud messages and managing user topic subscriptions, device groups and devices.

68328.5k1](/packages/edwinhoksberg-php-fcm)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
