PHPackages                             liyifei/yii2-jpush - 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. liyifei/yii2-jpush

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

liyifei/yii2-jpush
==================

a jpush encapsulation for yii2

1.0.0(10y ago)03MITPHP

Since Apr 1Pushed 6y agoCompare

[ Source](https://github.com/yii2-composer/yii2-jpush)[ Packagist](https://packagist.org/packages/liyifei/yii2-jpush)[ RSS](/packages/liyifei-yii2-jpush/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

JPUSH Encapsulation for Yii 2
=============================

[](#jpush-encapsulation-for-yii-2)

这个扩展提供了一个基于yii2的极光推送封装。

本代码仅是对极光推送做了一层yii2的封装，并不会修改到其中的源码，具体的许可可以参照[极光推送](http://docs.jpush.cn/display/dev/Push-API-v3)。

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).
推荐的方式是通过composer 进行下载安装[composer](http://getcomposer.org/download/)。

Either run
在命令行执行

```
php composer.phar require --prefer-dist "lspbupt/yii2-jpush" "*"

```

or add
或加入

```
"lspbupt/yii2-jpush": "*"

```

to the require-dev section of your `composer.json` file.
到你的`composer.json`文件中的require-dev段。

Usage
-----

[](#usage)

一旦你安装了这个插件，你就可以直接在配置文件中加入如下的代码：

```
return [
    'components' => [
        'jpush' => [
            'class' => 'lspbupt\push\Jpush',
            'app_key' => "", //极光推送的appkey
            'app_secret' => "", //极光推送的appsecret
        ],
    ],
    // ....
];
```

在配置好之后，你完全可以像之前使用jpush一样使用所有的方法

```
$result = Yii::$app->jpush->push()
    ->setPlatform('all')
    ->addAllAudience()
    ->setNotificationAlert('Hi, JPush')
    ->send();
```

具体的函数的方法可以访问[极光推送](http://docs.jpush.io/server/php_sdk/#composer)

另外，也可以按传统的方式使用该插件

```
$client = new \lspbupt\push\Jpush([
    'app_key' => $app_key,
    'app_secret' => $app_secret,
]);
$result = $client->push()
    ->setPlatform('all')
    ->addAllAudience()
    ->setNotificationAlert('Hi, JPush')
    ->send();
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity63

Established project with proven stability

 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

3694d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/74a3bec5eab6b4b9354429efc293a0efc28c5e479775d29b02f63d6e595eb8fd?d=identicon)[viperlyf](/maintainers/viperlyf)

---

Top Contributors

[![leeyifei](https://avatars.githubusercontent.com/u/5648265?v=4)](https://github.com/leeyifei "leeyifei (5 commits)")

---

Tags

yii2extensionjpush

### Embed Badge

![Health badge](/badges/liyifei-yii2-jpush/health.svg)

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

###  Alternatives

[vyants/yii2-daemon

Extension provides functionality for simple daemons creation and control

7859.0k](/packages/vyants-yii2-daemon)[richardfan1126/yii2-js-register

Yii2 widget to register JS into view

1357.2k7](/packages/richardfan1126-yii2-js-register)

PHPackages © 2026

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