PHPackages                             guanguans/yii-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. guanguans/yii-jpush

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

guanguans/yii-jpush
===================

适配于 Yii 的极光扩展包

v1.0.5(5y ago)5106MITPHP

Since Apr 27Pushed 4y ago1 watchersCompare

[ Source](https://github.com/guanguans/yii-jpush)[ Packagist](https://packagist.org/packages/guanguans/yii-jpush)[ Fund](https://www.guanguans.cn/images/wechat.jpeg)[ Patreon](https://www.patreon.com/guanguans)[ RSS](/packages/guanguans-yii-jpush/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (4)Versions (7)Used By (0)

yii-jpush
=========

[](#yii-jpush)

适配于 Yii 的极光推送扩展包

[![](./docs/usage.png)](./docs/usage.png)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/dfa7fc423d3a5fea7243a2483131dfcdc57cff8eb79f783e75b795f06c9db552/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6775616e6775616e732f7969692d6a707573682f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/guanguans/yii-jpush/?branch=master)[![codecov](https://camo.githubusercontent.com/20404d8df683a2722ecf65d9cb42c67c06648331fe67a9a7a688b53e1d788905/68747470733a2f2f636f6465636f762e696f2f67682f6775616e6775616e732f7969692d6a707573682f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/guanguans/yii-jpush)[![StyleCI](https://camo.githubusercontent.com/e2dca050a3700ff09f101f24b3b8620a380e6a177d8dd975ff2856ec4bf1bd7d/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3235383936333238352f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/258963285)[![Latest Stable Version](https://camo.githubusercontent.com/1cf79b7a2ad5aad1edc6d57554d86aa5424384a9963e57aece5798b9b2a8cb7b/68747470733a2f2f706f7365722e707567782e6f72672f6775616e6775616e732f7969692d6a707573682f762f737461626c65)](https://packagist.org/packages/guanguans/yii-jpush)[![Total Downloads](https://camo.githubusercontent.com/790de0e17a3ae5b0a5def8ed880d1233215884063598bcd04b2c99e6dccba0ef/68747470733a2f2f706f7365722e707567782e6f72672f6775616e6775616e732f7969692d6a707573682f646f776e6c6f616473)](https://packagist.org/packages/guanguans/yii-jpush)[![License](https://camo.githubusercontent.com/d901f25c1b6e49226795468c5400199ef2d9cd4b614b126878d26bb116cc068b/68747470733a2f2f706f7365722e707567782e6f72672f6775616e6775616e732f7969692d6a707573682f6c6963656e7365)](https://packagist.org/packages/guanguans/yii-jpush)

环境要求
----

[](#环境要求)

- yii &gt;= 2

安装
--

[](#安装)

```
$ composer require guanguans/yii-jpush --prefer-dist -v
```

配置
--

[](#配置)

Yii2 配置文件 `config/main.php` 的 components 中添加:

```
'components' => [
    // ...
    'jpush' => [
        'class' => 'Guanguans\YiiJpush\Jpush',
        'appKey' => 'xxxxxxxxxxx',
        'masterSecret' => 'xxxxxxxxxxx',
        'logFile' => './jpush.log', // 可选
        'retryTimes' => 3, // 可选
        'zone' => 'default', // 可选 [default, bj]
    ],
    // ...
]
```

使用，更多详细文档请参考 [jpush/jpush-api-php-client](https://github.com/jpush/jpush-api-php-client)
----------------------------------------------------------------------------------------

[](#使用更多详细文档请参考-jpushjpush-api-php-client)

### 获取 `JPush\Client` 实例

[](#获取-jpushclient-实例)

```
jpush->client
```

### 简单使用

[](#简单使用)

```
