PHPackages                             code-of-brain/firebase-messaging-php - 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. code-of-brain/firebase-messaging-php

ActiveLibrary

code-of-brain/firebase-messaging-php
====================================

This is simple to use PHP package for sending firebase messages.

v1.0.0(5y ago)111MITPHP

Since Feb 4Pushed 5y ago1 watchersCompare

[ Source](https://github.com/PoshanTyagi/Firebase-Messaging-PHP)[ Packagist](https://packagist.org/packages/code-of-brain/firebase-messaging-php)[ RSS](/packages/code-of-brain-firebase-messaging-php/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

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

[](#firebase-messaging-php)

Installation using composer
---------------------------

[](#installation-using-composer)

```
composer require code-of-brain/firebase-messaging-php
```

Send Notification to Client
---------------------------

[](#send-notification-to-client)

```
use FirebaseMessagingPhp\FirebaseClient;
use FirebaseMessagingPhp\FirebaseNotification;

$client = new FirebaseClient(SERVER_KEY);

$notification = new FirebaseNotification();

$notification->setTitle('title')
    ->setBody('body');

$clientToken = ['CLIENT_ID_1' => 'CLIENT_TOKEN_1'];

$response = $client->send($notification, $clientToken);

var_dump($response);
```

Send Notification to Multiple Clients
-------------------------------------

[](#send-notification-to-multiple-clients)

```
use FirebaseMessagingPhp\FirebaseClient;
use FirebaseMessagingPhp\FirebaseNotification;

$client = new FirebaseClient(SERVER_KEY);

$notification = new FirebaseNotification();

$notification->setTitle('title');
    ->setBody('body');

$clientTokens = ['CLIENT_ID_1' => 'CLIENT_TOKEN_1', 'CLIENT_ID_2' => 'CLIENT_TOKEN_2', 'CLIENT_ID_3' => 'CLIENT_TOKEN_3'];

$response = $client->send($notification, $clientTokens);

var_dump($response);
```

Clients Token Verification
--------------------------

[](#clients-token-verification)

```
use FirebaseMessagingPhp\FirebaseClient;
use FirebaseMessagingPhp\FirebaseNotification;

$client = new FirebaseClient(SERVER_KEY);

$clientTokens = ['CLIENT_ID_1' => 'CLIENT_TOKEN_1', 'CLIENT_ID_2' => 'CLIENT_TOKEN_2', 'CLIENT_ID_3' => 'CLIENT_TOKEN_3'];

$response = $client->verifyTokens($clientTokens);

var_dump($response);
```

Optional Parameters
-------------------

[](#optional-parameters)

```
$notification = new FirebaseNotification();

// You can add priority to notification by using setPriority method
// Priority can be 'high' and 'normal'
// By default priority is 'normal'

$notification->setPriority('high');

// You can add extra data to notification by using setData method
// Data should be a array of string key-value pair

$notification->setData(array('name' => 'user', 'id' => '1111'));

// This method is use to specifies how long (in seconds) the message should be kept in FCM storage if the device is offline
// The maximum time to live supported is 4 weeks, and the default value is 4 weeks

$notification->setTimeToLive( 60 * 60 ); // 60 * 60 = 3600 means message should be kept in FCM storage for 3600 seconds (1 hour)
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

1929d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ea69077b623150f941983476a891fbd37ce5c7f0b7ec761937bbe9f88d473daa?d=identicon)[code-of-brain](/maintainers/code-of-brain)

---

Top Contributors

[![PoshanTyagi](https://avatars.githubusercontent.com/u/62825038?v=4)](https://github.com/PoshanTyagi "PoshanTyagi (6 commits)")

### Embed Badge

![Health badge](/badges/code-of-brain-firebase-messaging-php/health.svg)

```
[![Health](https://phpackages.com/badges/code-of-brain-firebase-messaging-php/health.svg)](https://phpackages.com/packages/code-of-brain-firebase-messaging-php)
```

PHPackages © 2026

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