PHPackages                             nizerin/jpush-mini - 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. nizerin/jpush-mini

ActiveLibrary[API Development](/categories/api)

nizerin/jpush-mini
==================

JPush API PHP Client

1.0.0(6y ago)03MITPHPPHP &gt;=5.4

Since Sep 29Pushed 6y agoCompare

[ Source](https://github.com/PHP-OPEN-HUB/jpush-mini)[ Packagist](https://packagist.org/packages/nizerin/jpush-mini)[ Docs](https://github.com/jpush/jpush-api-php-client)[ RSS](/packages/nizerin-jpush-mini/feed)WikiDiscussions master Synced 2d ago

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

JPush API PHP Client
====================

[](#jpush-api-php-client)

这是 JPush REST API 的 PHP 版本封装开发包，是由极光推送官方提供的，一般支持最新的 API 功能。

对应的 REST API 文档: [https://docs.jiguang.cn/jpush/server/push/server\_overview/](https://docs.jiguang.cn/jpush/server/push/server_overview/)

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

[](#installation)

#### 使用 Composer 安装

[](#使用-composer-安装)

```
composer require nizerin/jpush-mini
```

Usage
-----

[](#usage)

- [Init API](https://github.com/jpush/jpush-api-php-client/blob/master/doc/api.md#init-api)
- [Push API](https://github.com/jpush/jpush-api-php-client/blob/master/doc/api.md#push-api)
- [Exception Handle](https://github.com/jpush/jpush-api-php-client/blob/master/doc/api.md#schedule-api)
- [HTTP/2 Support](https://github.com/jpush/jpush-api-php-client/blob/master/doc/http2.md)
- [Group Push](https://github.com/jpush/jpush-api-php-client/blob/master/doc/grouppush.md)

#### 初始化

[](#初始化)

```
use JPush\Client as JPush;
...
...

    $client = new JPush($app_key, $master_secret);

...
```

OR

```
$client = new \JPush\Client($app_key, $master_secret);
```

#### 简单推送

[](#简单推送)

```
$client->push()
    ->setPlatform('all')
    ->addAllAudience()
    ->setNotificationAlert('Hello, JPush')
    ->send();
```

#### 异常处理

[](#异常处理)

```
$pusher = $client->push();
$pusher->setPlatform('all');
$pusher->addAllAudience();
$pusher->setNotificationAlert('Hello, JPush');
try {
    $pusher->send();
} catch (\JPush\Exceptions\JPushException $e) {
    // try something else here
    print $e;
}
```

Examples
--------

[](#examples)

**注意: 这只是使用样例, 不应该直接用于实际环境中!!**

在下载的中的 [examples](https://github.com/jpush/jpush-api-php-client/tree/master/examples) 文件夹有简单示例代码, 开发者可以参考其中的样例快速了解该库的使用方法。

> \*\*注：所下载的样例代码不可马上使用，需要在 `examples/config.php` 文件中填入相关的必要参数，或者设置相关环境变量，不进行这个操作则示例运行会失败。\*\*另外为保护开发者隐私 examples/config.php 文件不在版本控制中，需要使用如下命令手动复制：

```
$ cp examples/config.php.example examples/config.php
```

**简单使用方法**

若要运行 push\_example.php 中的示例代码：

```
# 假定当前目录为 JPush 源码所在的根目录
$ php examples/push_example.php
```

> 同时也可编辑相关的示例文件，更改参数查看执行效果

Testing
-------

[](#testing)

```
# 编辑 tests/bootstrap.php 文件，填入必须的变量值
# OR 设置相应的环境变量

# 运行全部测试用例
$ composer tests

# 运行某一具体测试用例
$ composer tests/JPush/xxTest.php
```

Contributing
------------

[](#contributing)

Bug reports and pull requests are welcome on GitHub at .

License
-------

[](#license)

The library is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

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 ~0 days

Total

2

Last Release

2466d ago

Major Versions

0.0.1 → 1.0.02019-09-29

### Community

Maintainers

![](https://www.gravatar.com/avatar/573fcf255345bc64772d2c61b862bd91ff59089560d78094eb218a4df1d72e35?d=identicon)[nizerin](/maintainers/nizerin)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/nizerin-jpush-mini/health.svg)

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

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35816.3M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172437.8k11](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

94452.6k6](/packages/botman-driver-telegram)

PHPackages © 2026

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