PHPackages                             kangshifu/push - 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. [Mail &amp; Notifications](/categories/mail)
4. /
5. kangshifu/push

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

kangshifu/push
==============

消息推送整合包：极光推送、个推推送、小米推送

05PHP

Since Jan 21Pushed 7y agoCompare

[ Source](https://github.com/MyFeys/push)[ Packagist](https://packagist.org/packages/kangshifu/push)[ RSS](/packages/kangshifu-push/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (1)Used By (0)

推送
==

[](#推送)

### 支持

[](#支持)

1. 通知消息
2. 透传消息
3. 指定regID或alias推送
4. 多个推送平台

#### 安装：

[](#安装-)

> composer require kangshifu/push '1.1.0'
> 或者 github 上clone到本地vendor目录下

#### 配置

[](#配置)

kangshifu/push/src/config.php

```

    return [

           'redis' => [
               'host' => '127.0.0.1',
               'port' => 6379
           ],

           'jpush' => [
               'app_key' => 'b4db0861228951f5d51aaa49',
               'master_secret' => '7ff02e0a6a2bedc7f9ff6adf',
           ],

           'getui' => [
               'appid' => 'eahZVAGVE58QKKdb1caOD',
               'appSecret' => 'mEtFbTGCbp9KLgNjoA7W12',
               'appKey' => '9NIFA16vcX8v3fYpw4aA78',
               'masterSecret' => 'Q8gNDuoYsd9X3R6ljCtp7A'
           ],

           'xmpush' => [
               'appid' => '2882303761517778721',
               'appKey' => '5351777811721',
               'appSecret' => '+Sz3gZv13cWJkg+b6lNsTQ=='
           ]

    ];

```

#### 推送

[](#推送-1)

```
    use kangshifu\push\Push;

    public function actionIndex()
    {
        $push = new Push($this->data);
        return $push->send();
    }

```

数据格式：

```
   $this->data = [
        'service' => 'jpush',
        'notification' => [
            'title' => '通知标题',
            'content' => '通知消息内容'
        ],
        'message' => [
            'title' => '透传标题',
            'content' => '透传消息内容'
        ],
        'audience' => 'all', //默认为all，向所有设备发送
        // 'alias' => 'xidada, telangpu' //根据别名推送
        'time_to_live' => 0, //离线缓存时长
    ]

    /**
     * message 与 notification 二选一，必填一个，两者并存透传有效，极光推送两者有效。
     * audience 为注册ID，多个用逗号分隔
     * service 为推送平台，目前实现的有极光、个推
     */

```

返回值

```

    {
        code: 0,  //0表示推送成功，1表示推送失败
        msg: ''  //错误消息
    }

```

#### 查询状态

[](#查询状态)

```
    use kangshifu\push\Push;

    public function actionIndex()
    {
        $push = new Push($this->data);
        return $push->getStatus($msg_id, $reg_ids);
    }

```

数据格式：

```
   $this->data = [
        'service' => 'jpush',
        'msg_id' => '123123132',
        'reg_ids' => '123412,sadfas'
    ]

    /**
     * msg_id 消息id
     * reg_ids 注册ID
     * service 为推送平台，目前实现的有极光、个推
     */

```

返回值

```

    {
        "02078f0f1b8": {
            "status": 2
        },
        "1507bfd3a7c568d4761": {
            "status": 0
        },
        "0207870a9b8": {
            "status": 2
        }
    }

    // status 含义：

    // 0: 送达；
    // 1: 未送达；
    // 2: registration_id 不属于该应用；
    // 3: registration_id 属于该应用，但不是该条 message 的推送目标；
    // 4: 系统异常。

```

###  Health Score

19

—

LowBetter than 9% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7012047?v=4)[kangshifu](/maintainers/kangshifu)[@kangshifu](https://github.com/kangshifu)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/kangshifu-push/health.svg)

```
[![Health](https://phpackages.com/badges/kangshifu-push/health.svg)](https://phpackages.com/packages/kangshifu-push)
```

###  Alternatives

[mattketmo/email-checker

Throwaway email detection library

2742.1M5](/packages/mattketmo-email-checker)[sarfraznawaz2005/noty

Laravel package to incorporate noty flash notifications into laravel.

324.5k](/packages/sarfraznawaz2005-noty)

PHPackages © 2026

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