PHPackages                             dantart/yii2-onesignal - 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. [API Development](/categories/api)
4. /
5. dantart/yii2-onesignal

ActiveLibrary[API Development](/categories/api)

dantart/yii2-onesignal
======================

Yii2 component for OneSignal.com integration

1.0(5y ago)051MITPHP

Since Dec 1Pushed 5y ago1 watchersCompare

[ Source](https://github.com/dantart/yii2-onesignal)[ Packagist](https://packagist.org/packages/dantart/yii2-onesignal)[ RSS](/packages/dantart-yii2-onesignal/feed)WikiDiscussions main Synced 2d ago

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

yii2-onesignal
==============

[](#yii2-onesignal)

Yii2 component for OneSignal.com integration. Any contribution is highly encouraged!

This component is a [rocketfirm/yii2-onesignal](https://github.com/rocket-firm/yii2-onesignal) fork.

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

[](#installation)

Preferred way to install is through [Composer](https://getcomposer.org/doc/00-intro.md#installation-linux-unix-osx).

```
composer require dantart/yii2-onesignal

```

Configuration
-------------

[](#configuration)

Add following code to your configuration file (main.php):

```
'components' => [
  // ...

  'onesignal' => [
    'appId' => 'ONESIGNAL_APP_ID',
    'apiKey' => 'ONESIGNAL_API_KEY',
  ]
]
```

Usage
-----

[](#usage)

Run following command to send notifications:

```
$message = [
  "headers" => [
    "en" => "Notification Example"
  ],
  "contents" => [
    "en" => "Click for more info"
  ]
];

$options = [
  "template_id" => "your-template-id",
  "url" => "https://github.com/dantart/yii2-onesignal"
];

$filterOne = ["field" => "tag", "key" => "your_tag_here", "relation" => "=", "value" => "your_tag_value_here"];
$filterOne = ["field" => "tag", "key" => "your_tag_here", "relation" => "=", "value" => "your_tag_value_here"];

$notification = \Yii::$app->onesignal->notifications()->create($message["headers"], $message["contents"], $options);
$notification->filter($filterOne);
$notification->operatorOr();
$notification->filter($filterTwo);

$notification->send();
```

### Other methods:

[](#other-methods)

```
// Notifications
\Yii::$app->onesignal->notifications()->getAll($params);
\Yii::$app->onesignal->notifications($id)->getOne();

//Players (device)
\Yii::$app->onesignal->players()->getAll($params);
\Yii::$app->onesignal->players($id)->getOne();
\Yii::$app->onesignal->players($id)->edit($params);
\Yii::$app->onesignal->players($id)->addTag($tagName, $tagValue);
\Yii::$app->onesignal->players($id)->addTag($tagsArray);
\Yii::$app->onesignal->players($id)->removeTag($tagName);
```

Visit official [onesignal.com documentation](https://documentation.onesignal.com/) for more details.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

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

1989d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/647a0856cbc78cd2f38932ee3bb48f7791d16211f933f476a5e3cd3ef3acce7a?d=identicon)[dantart](/maintainers/dantart)

---

Top Contributors

[![adantart](https://avatars.githubusercontent.com/u/695272?v=4)](https://github.com/adantart "adantart (2 commits)")

### Embed Badge

![Health badge](/badges/dantart-yii2-onesignal/health.svg)

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

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

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