PHPackages                             redjanym/fcm-bundle - 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. redjanym/fcm-bundle

ActiveSymfony-bundle[Mail &amp; Notifications](/categories/mail)

redjanym/fcm-bundle
===================

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

v2.1.1(4mo ago)43459.4k↓44.2%19MITPHPPHP &gt;=7.4CI failing

Since Oct 9Pushed 4mo ago6 watchersCompare

[ Source](https://github.com/redjanym/FCMBundle)[ Packagist](https://packagist.org/packages/redjanym/fcm-bundle)[ Docs](https://github.com/redjanym/FCMBundle)[ RSS](/packages/redjanym-fcm-bundle/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (10)Dependencies (7)Versions (19)Used By (0)

FCMBundle
---------

[](#fcmbundle)

A Symfony Bundle for sending push notifications to mobile devices (Android, iOS) and web browsers via Google's **Firebase Cloud Messaging HTTP V1 API**.

### Requirements

[](#requirements)

- PHP &gt;= 7.4
- Symfony 5.4 / 6.x / 7.x

### Installation

[](#installation)

```
composer require redjanym/fcm-bundle
```

### Configuration

[](#configuration)

Add your Firebase service account JSON file path to your Symfony configuration:

```
# config/packages/redjan_ym_fcm.yaml
redjan_ym_fcm:
    service_account_file: '%kernel.project_dir%/config/firebase/service-account.json'
```

You can download the service account file from the [Firebase Console](https://console.firebase.google.com/) under **Project Settings &gt; Service accounts &gt; Generate new private key**.

### Usage

[](#usage)

#### Sending to a Device

[](#sending-to-a-device)

```
use RedjanYm\FCM\Notification;
use RedjanYm\FCM\Recipient\Device;

// Using the notification factory (recommended)
$factory = $this->container->get('redjan_ym_fcm.notification_factory');
$notification = $factory->createDeviceNotification(
    'device-token-here',
    'Notification Title',
    'Notification Body',
    ['key' => 'value']  // optional data payload
);

// Or manually
$notification = new Notification(
    new Device('device-token-here'),
    'Notification Title',
    'Notification Body'
);

// Send
$client = $this->container->get('redjan_ym_fcm.client');
$response = $client->send($notification);
```

#### Sending to a Topic

[](#sending-to-a-topic)

Send notifications to all devices subscribed to a topic:

```
use RedjanYm\FCM\Notification;
use RedjanYm\FCM\Recipient\Topic;

// Using the notification factory (recommended)
$factory = $this->container->get('redjan_ym_fcm.notification_factory');
$notification = $factory->createTopicNotification(
    'news',
    'Breaking News',
    'Something important happened',
    ['url' => 'https://example.com/article/123']
);

// Or manually
$notification = new Notification(
    new Topic('news'),
    'Breaking News',
    'Something important happened'
);

// Send
$client = $this->container->get('redjan_ym_fcm.client');
$response = $client->send($notification);
```

#### Customizing Notifications

[](#customizing-notifications)

The `Notification` object exposes public properties for platform-specific settings:

```
$notification->image = 'https://example.com/image.png';
$notification->sound = 'default';
$notification->badge = 1;
$notification->icon = 'ic_notification';
$notification->color = '#FF0000';
$notification->clickAction = 'OPEN_ACTIVITY';
$notification->androidChannelId = 'my_channel';
$notification->androidPriority = 'high';
$notification->apnsPriority = '10';
$notification->ttl = '3600s';
$notification->analyticsLabel = 'campaign_123';

// Extra settings arrays for platform-specific customization
$notification->extraNotificationSettings = ['tag' => 'my-tag'];
$notification->extraAPNSHeadersSettings = ['apns-collapse-id' => 'campaign'];
$notification->webPushHeadersSettings = ['TTL' => '86400'];
```

### Available Services

[](#available-services)

Service IDClassDescription`redjan_ym_fcm.client``RedjanYm\FCM\Client`FCM HTTP V1 API client`redjan_ym_fcm.notification_factory``RedjanYm\FCMBundle\NotificationFactory`Factory for creating device and topic notifications### Running Tests

[](#running-tests)

```
composer install
vendor/bin/phpunit
```

### License

[](#license)

MIT

###  Health Score

57

—

FairBetter than 98% of packages

Maintenance75

Regular maintenance activity

Popularity48

Moderate usage in the ecosystem

Community16

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 95.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 ~247 days

Recently: every ~645 days

Total

15

Last Release

136d ago

Major Versions

1.1.62 → 2.0.02025-01-27

PHP version history (2 changes)1.0.0PHP &gt;=5.3

2.0.0PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/07a32e6587acf1bc5a3fa4e2be10d791f9b85987136d11a17db5420928793dce?d=identicon)[redjanym](/maintainers/redjanym)

---

Top Contributors

[![redjanym](https://avatars.githubusercontent.com/u/15679866?v=4)](https://github.com/redjanym "redjanym (46 commits)")[![Progi1984](https://avatars.githubusercontent.com/u/1533248?v=4)](https://github.com/Progi1984 "Progi1984 (2 commits)")

---

Tags

androidbundlefcmfcmbundlefirebase-cloud-messaginghacktoberfestiosnotificationssymfonysymfony-bundlephpsymfonybundlecloudgooglenotificationsfirebaseFCMchromeandroidiosHTTP V1

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/redjanym-fcm-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/redjanym-fcm-bundle/health.svg)](https://phpackages.com/packages/redjanym-fcm-bundle)
```

###  Alternatives

[redjanym/php-firebase-cloud-messaging

PHP SDK for Firebase Cloud Messaging from Google

39869.8k2](/packages/redjanym-php-firebase-cloud-messaging)[paragraph1/php-fcm

PHP application server for google firebase cloud messaging (FCM)

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

Firebase cloud messaging http v1 php

126.4k](/packages/kedniko-firebase-cloud-messaging-http-v1-php)[coder966/fcm-simple

PHP library for Firebase Cloud Messaging

141.2k](/packages/coder966-fcm-simple)[vyconsulting-group/push-notification

PHP wrapper FCM

154.4k](/packages/vyconsulting-group-push-notification)

PHPackages © 2026

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