daidai118 / yii2-baidupusher
百度推送yii2封装 只是抽出config而已
Installs: 13
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 1
Open Issues: 2
Type:yii2-extension
Requires
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2024-11-05 22:16:56 UTC
README
百度推送yii2封装 只是抽出config而已 ,基于3.0。1的sdk包 修改,如果本身sdk错误等自行修复
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist baidupusher/yii2-baidupusher "*"
or add
"baidupusher/yii2-baidupusher": "*"
to the require section of your composer.json
file.
Usage
Once the extension is installed, simply use it in your code by : 追加到components中
'push'=>[
'class'=>'daidai118\baidupusher\PushSDK',
'config'=>[
/*
* const LOG_LEVEL_DEV = 0; // 开发状态, rd开发时使用, 最详细 log. 发布后被移除
const LOG_LEVEL_TRACE = 1; // 开发者开发时状态,隐藏rd开发时的细碎信息
const LOG_LEVEL_ONLINE = 2; // 开发者线上使用, 只有fault和warn
const LOG_LEVEL_ONLINE_FAULT = 3; // 开发者线上使用, 只有fault
const LOG_LEVEL_ONLINE_SILENCE = 4; // 静默.
*/
'default_secretkey'=>'',
'default_apiKey'=>'',
//3安卓 4 ios
'default_devicetype'=>3,
'SUPPRESS_EXCPTION'=>true,
'LOG_OUTPUT'=>'stdout',
'LOG_LEVEL'=>1,
'HOST'=>'http://api.tuisong.baidu.com/rest/3.0/',
'SIGN_EXPIRES'=>0,
],
]
Yii::$app->push->pushMsgToSingleDevice($channelId,$message,$opts);