打印下:
dd($result);
private function __processResp($response) {
if($response['http_code'] === 200) {
$body = array();
$body['data'] = json_decode($response['body']);
$headers = $response['headers'];
if (is_array($headers)) {
$limit = array();
foreach (self::$LIMIT_KEYS as $key => $value) {
if (array_key_exists($key, $headers)) {
$limit[$value] = $headers[$key];
}
}
if (count($limit) > 0) {
$body['limit'] = (object)$limit;
}
return (object)$body;
}
return $body;
} else {
throw new APIRequestException($response);
}
}
try {
$result = $client->push()
->setPlatform('all')
->addAllAudience()
->setNotificationAlert('Hi, JPush')
->send()
// 正常返回的情况
dd($result);
} catch (APIRequestException $e) {
echo "状态码:" . $e->httpCode ."
";
dd($e);
}