Closed Geeker4py closed 6 years ago
请提供更详细的信息
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;
}
}
}
按照 readme 里面的介绍通过 composer 来安装的v3.5版本 但是 会报 [1004]: Authen failed ,我通过 jpush-api-php-client-3.5.22 这个原生php包测试 ,同样的写法配置 就完全没有问题
$client = new JPush(Config::get('const.jpush.appKey'), Config::get('const.jpush.masterSecret'));
你先把信息填到这里里面测试一下
啊 是我的错 ,变量里面有个空格 ,导致你们那边 认为是一个为识别的用户 . sorry
ok,那这个 issue 就关了哈
我用的laravel 通过composer安装的3.5版本无法通过身份验证 ,但 sdk 就可以,两方都是相同的配置