通过composer安装的3.5版本无法通过身份验证
Geeker4py opened this issue · 6 comments
Geeker4py commented
我用的laravel 通过composer安装的3.5版本无法通过身份验证 ,但 sdk 就可以,两方都是相同的配置
helperhaps commented
请提供更详细的信息
Geeker4py commented
use JPush\Client as JPush;
use Illuminate\Support\Facades\Log;
class JPushController extends Controller
{
public function index() {
$client = new JPush(Config::get('const.jpush.appKey'), Config::get('const.jpush.masterSecret'));
$push = $client->push();
$push->setPlatform('all');
$push->addAllAudience();
$push->setNotificationAlert('中秋佳节,祝您和家人团圆美满,幸福安康!');
try {
$response = $push->send();
print_r($response);
} catch (\JPush\Exceptions\APIConnectionException $e) {
// try something here
print $e;
} catch (\JPush\Exceptions\APIRequestException $e) {
// try something here
print $e;
}
}
}
Geeker4py commented
按照 readme 里面的介绍通过 composer 来安装的v3.5版本
但是 会报 [1004]: Authen failed ,我通过 jpush-api-php-client-3.5.22 这个原生php包测试 ,同样的写法配置 就完全没有问题
helperhaps commented
$client = new JPush(Config::get('const.jpush.appKey'), Config::get('const.jpush.masterSecret'));
你先把信息填到这里里面测试一下
Geeker4py commented
啊 是我的错 ,变量里面有个空格 ,导致你们那边 认为是一个为识别的用户 . sorry
helperhaps commented
ok,那这个 issue 就关了哈