dev-master
9999999-deva jpush encapsulation for yii2
MIT
The Requires
by 李仕鹏
extension yii2 jpush
1.0.0
1.0.0.0a jpush encapsulation for yii2
MIT
The Requires
by 李仕鹏
extension yii2 jpush
a jpush encapsulation for yii2
这个扩展提供了一个基于yii2的极光推送封装。, (*1)
本代码仅是对极光推送做了一层yii2的封装,并不会修改到其中的源码,具体的许可可以参照极光推送。, (*2)
The preferred way to install this extension is through composer.
推荐的方式是通过composer 进行下载安装composer。, (*3)
Either run
在命令行执行, (*4)
php composer.phar require --prefer-dist "lspbupt/yii2-jpush" "*"
or add
或加入, (*5)
"lspbupt/yii2-jpush": "*"
to the require-dev section of your composer.json
file.
到你的composer.json
文件中的require-dev段。, (*6)
一旦你安装了这个插件,你就可以直接在配置文件中加入如下的代码:, (*7)
return [ 'components' => [ 'jpush' => [ 'class' => 'lspbupt\push\Jpush', 'app_key' => "", //极光推送的appkey 'app_secret' => "", //极光推送的appsecret ], ], // .... ];
在配置好之后,你完全可以像之前使用jpush一样使用所有的方法, (*8)
$result = Yii::$app->jpush->push() ->setPlatform('all') ->addAllAudience() ->setNotificationAlert('Hi, JPush') ->send();
具体的函数的方法可以访问极光推送, (*9)
另外,也可以按传统的方式使用该插件, (*10)
$client = new \lspbupt\push\Jpush([ 'app_key' => $app_key, 'app_secret' => $app_secret, ]); $result = $client->push() ->setPlatform('all') ->addAllAudience() ->setNotificationAlert('Hi, JPush') ->send();
a jpush encapsulation for yii2
MIT
extension yii2 jpush
a jpush encapsulation for yii2
MIT
extension yii2 jpush