PHPackages                             el-dorian-global/php-firebase-cloud-messaging - 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. el-dorian-global/php-firebase-cloud-messaging

ActiveLibrary

el-dorian-global/php-firebase-cloud-messaging
=============================================

PHP API for Firebase Cloud Messaging from Google

v1.0.2(1y ago)014MITPHPPHP &gt;=5.5

Since Oct 6Pushed 1y agoCompare

[ Source](https://github.com/el-dorian-global/php-firebase-cloud-messaging)[ Packagist](https://packagist.org/packages/el-dorian-global/php-firebase-cloud-messaging)[ Docs](https://github.com/el-dorian-global/php-firebase-cloud-messaging)[ RSS](/packages/el-dorian-global-php-firebase-cloud-messaging/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (4)Used By (0)

PHP Firebase Cloud Messaging
============================

[](#php-firebase-cloud-messaging)

PHP API for Firebase Cloud Messaging from Google.

Currently this app server library only supports sending Messages/Notifications via HTTP.

See original Firebase docs:

\#Setup Install via Composer:

```
composer require veldor/php-firebase-cloud-messaging

```

Or add this to your composer.json and run "composer update":

```
"require": {
    "veldor/php-firebase-cloud-messaging": "dev-master"
}

```

\#Send message to Device

```
use veldor\PhpFirebaseCloudMessaging\Client;
use veldor\PhpFirebaseCloudMessaging\Message;
use veldor\PhpFirebaseCloudMessaging\Recipient\Device;
use veldor\PhpFirebaseCloudMessaging\Notification;

$server_key = '_YOUR_SERVER_KEY_';
$client = new Client();
$client->setApiKey($server_key);
$client->injectGuzzleHttpClient(new \GuzzleHttp\Client());

$message = new Message();
$message->setPriority('high');
$message->addRecipient(new Device('_YOUR_DEVICE_TOKEN_'));
$message
    ->setNotification(new Notification('some title', 'some body'))
    ->setData(['key' => 'value'])
;

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

```

\#Send message to multiple Devices

```
...
$message = new Message();
$message->setPriority('high');
$message->addRecipient(new Device('_YOUR_DEVICE_TOKEN_'));
$message->addRecipient(new Device('_YOUR_DEVICE_TOKEN_2_'));
$message->addRecipient(new Device('_YOUR_DEVICE_TOKEN_3_'));
$message
    ->setNotification(new Notification('some title', 'some body'))
    ->setData(['key' => 'value'])
;
...

```

\#Send message to Topic

```
use veldor\PhpFirebaseCloudMessaging\Client;
use veldor\PhpFirebaseCloudMessaging\Message;
use veldor\PhpFirebaseCloudMessaging\Recipient\Topic;
use veldor\PhpFirebaseCloudMessaging\Notification;

$server_key = '_YOUR_SERVER_KEY_';
$client = new Client();
$client->setApiKey($server_key);
$client->injectGuzzleHttpClient(new \GuzzleHttp\Client());

$message = new Message();
$message->setPriority('high');
$message->addRecipient(new Topic('_YOUR_TOPIC_'));
$message
    ->setNotification(new Notification('some title', 'some body'))
    ->setData(['key' => 'value'])
;

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

```

\#Send message to multiple Topics

See Firebase documentation for sending to [combinations of multiple topics](https://firebase.google.com/docs/cloud-messaging/topic-messaging#sending_topic_messages_from_the_server).

```
...
$message = new Message();
$message->setPriority('high');
$message->addRecipient(new Topic('_YOUR_TOPIC_'));
$message->addRecipient(new Topic('_YOUR_TOPIC_2_'));
$message->addRecipient(new Topic('_YOUR_TOPIC_3_'));
$message
    ->setNotification(new Notification('some title', 'some body'))
    ->setData(['key' => 'value'])
    // Will send to devices subscribed to topic 1 AND topic 2 or 3
    ->setCondition('%s && (%s || %s)')
;
...

```

\#Subscribe user to the topic

```
use veldor\PhpFirebaseCloudMessaging\Client;

$server_key = '_YOUR_SERVER_KEY_';
$client = new Client();
$client->setApiKey($server_key);
$client->injectGuzzleHttpClient(new \GuzzleHttp\Client());

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

```

\#Remove user subscription to the topic

```
use veldor\PhpFirebaseCloudMessaging\Client;

$server_key = '_YOUR_SERVER_KEY_';
$client = new Client();
$client->setApiKey($server_key);
$client->injectGuzzleHttpClient(new \GuzzleHttp\Client());

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

```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 Bus Factor1

Top contributor holds 68.8% of commits — single point of failure

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 ~0 days

Total

3

Last Release

579d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/29a44df0dbf4bb6b0fa97d4537b08c13f53ccb8692fbe6f390c2631263864ac6?d=identicon)[el-dorian-global](/maintainers/el-dorian-global)

---

Top Contributors

[![sngrl](https://avatars.githubusercontent.com/u/6196684?v=4)](https://github.com/sngrl "sngrl (11 commits)")[![el-dorian](https://avatars.githubusercontent.com/u/101883624?v=4)](https://github.com/el-dorian "el-dorian (4 commits)")[![johann59](https://avatars.githubusercontent.com/u/9280133?v=4)](https://github.com/johann59 "johann59 (1 commits)")

---

Tags

phpcloudgooglenotificationsfirebaseFCMchromeandroidios

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/el-dorian-global-php-firebase-cloud-messaging/health.svg)

```
[![Health](https://phpackages.com/badges/el-dorian-global-php-firebase-cloud-messaging/health.svg)](https://phpackages.com/packages/el-dorian-global-php-firebase-cloud-messaging)
```

###  Alternatives

[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)[redjanym/php-firebase-cloud-messaging

PHP SDK for Firebase Cloud Messaging from Google

39847.9k1](/packages/redjanym-php-firebase-cloud-messaging)[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)[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)[bentools/webpush-bundle

Send push notifications through Web Push Protocol to your Symfony users.

71274.3k](/packages/bentools-webpush-bundle)

PHPackages © 2026

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