vivlong/phalapi-aliyun-push

This package is abandoned and no longer maintained. The author suggests using the vivlong/phalapi-xpush package instead.

PhalApi 2.x 扩展类库:基于阿里云移动推送的服务端扩展。

dev-master 2020-12-10 06:03 UTC

This package is auto-updated.

Last update: 2020-12-16 09:57:48 UTC


README

PhalApi 2.x 扩展类库:基于阿里云移动推送的服务端扩展。
Packagist

安装和配置

修改项目下的composer.json文件,并添加:

    "vivlong/phalapi-aliyun-push":"dev-master"

然后执行composer update

安装成功后,添加以下配置到/path/to/phalapi/config/app.php文件:

    /**
     * 阿里云推送相关配置
     */
    'AliyunPush' =>  array(
        'accessKeyId'       => '<yourAccessKeyId>',
        'accessKeySecret'   => '<yourAccessKeySecret>',
        'appKey'            => '<yourAppKey>',
        'regionId'          => 'cn-hangzhou',
        'androidChannel'    => '<yourChannel>',
        'androidPopupActivity' => 'Activity',
    ),

并根据自己的情况修改填充。

注册

在/path/to/phalapi/config/di.php文件中,注册:

$di->aliyunPush = function() {
    return new \PhalApi\AliyunPush\Lite();
};

使用

使用方式:

  \PhalApi\DI()->aliyunPush->push();