PHPackages                             autoxloo/yii2-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. autoxloo/yii2-fcm

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

autoxloo/yii2-fcm
=================

Yii2 wrap on autoxloo/fcm

1.0.0(7y ago)03.2kBSD-3-ClausePHPPHP &gt;=5.5.0

Since Dec 18Pushed 1y ago1 watchersCompare

[ Source](https://github.com/autoxloo/yii2-fcm)[ Packagist](https://packagist.org/packages/autoxloo/yii2-fcm)[ RSS](/packages/autoxloo-yii2-fcm/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

Yii2 wrap of [autoxloo/fcm](https://github.com/VasylDmytruk/fcm)
================================================================

[](#yii2-wrap-of-autoxloofcm)

Yii2 wrap of autoxloo/fcm

> Note: This package is not supported properly

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist autoxloo/yii2-fcm "*"

```

or

```
composer require --prefer-dist autoxloo/yii2-fcm "*"

```

or add

```
"autoxloo/yii2-fcm": "*"

```

to the require section of your `composer.json` file.

Config
------

[](#config)

In your application config add:

```
// ...
'components' => [
        // ...
        'firebaseNotification' => [
            'class' => \autoxloo\yii2\fcm\FirebaseCMNotification::class,
            'projectId' => 'project-id',
            'serviceAccountFile' => __DIR__ . '/service_account.json',
        ],
],

```

Usage
-----

[](#usage)

Once the extension is installed, simply use it in your code by:

```
$token = 'some device token';
$name = 'Some name';
$title = 'Some title';
$body = 'Some body';
$data = [
    'some key1' => 'some value1',
    'some key2' => 'some value2',
];

// sending push notification:

$target = FCMFacade::createTargetToken($token);     // only target is required
$notification = FCMFacade::createNotification($title, $body);
$androidConfig = FCMFacade::createAndroidConfig([AndroidConfig::FIELD_PRIORITY => AndroidConfig::PRIORITY_HIGH]);

$message = FCMFacade::createMessage();
$message->setTarget($target)
    ->setName($name)
    ->setData($data)
    ->setNotification($notification)
    ->setAndroidConfig($androidConfig);

$response = Yii::$app->firebaseNotification->send($message);   // $response is instance of \GuzzleHttp\Psr7\Response
```

Or

```
$messageConfig = [
    // required one of: token, topic or condition
    Message::FIELD_TOKEN => $token,     // or Message::FIELD_TOPIC => $topic or Message::FIELD_CONDITION => $condition

    // not required values:
    Message::FIELD_NAME => $name,
    Message::FIELD_DATA => $data,
    Message::FIELD_NOTIFICATION => FCMFacade::createNotification($title, $body),
    Message::FIELD_ANDROID => FCMFacade::createAndroidConfig([
        AndroidConfig::FIELD_PRIORITY => AndroidConfig::PRIORITY_HIGH
    ]),
];

$message = FCMFacade::createMessage($messageConfig);

$response = Yii::$app->firebaseNotification->send($message);   // $response is instance of \GuzzleHttp\Psr7\Response
```

Target
------

[](#target)

You can use target one of:

- `TargetToken`
- `TargetTopic`
- `TargetCondition`

To create use facade:

```
$targetToken = FCMFacade::createTargetToken('some token');
$targetTopic = FCMFacade::createTargetTopic('some topic');
$targetCondition = FCMFacade::createTargetConsition('some condition');
```

See [autoxloo/fcm](https://github.com/VasylDmytruk/fcm) for more details.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance28

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

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

2703d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1e0af05c82328c2e95f5808024281b4f3779bed0a7abb450943973f1f6388472?d=identicon)[autoxloo](/maintainers/autoxloo)

---

Top Contributors

[![VasylDmytruk](https://avatars.githubusercontent.com/u/32508794?v=4)](https://github.com/VasylDmytruk "VasylDmytruk (15 commits)")

---

Tags

FCMyii2Firebase Cloud Messaging

### Embed Badge

![Health badge](/badges/autoxloo-yii2-fcm/health.svg)

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

###  Alternatives

[aksafan/yii2-fcm-both-api

Yii2 Extension for sending push notification with both Firebase Cloud Messaging (FCM) HTTP Server Protocols (APIs).

1552.4k1](/packages/aksafan-yii2-fcm-both-api)[dmstr/yii2-cookie-consent

Yii2 Cookie Consent Widget

1452.6k](/packages/dmstr-yii2-cookie-consent)

PHPackages © 2026

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