用最简单的极光推送

jpush
标签: #<Tag:0x00007fb83ce8c190>

(大白菜) #1

require dirname(dirname(FILE)). ‘/config.php’;
// 获取指定设备的 Mobile,Alias,Tags 等信息
$response = $client->device()->getDevices($registration_id);
print_r($response);

/phpstudy/www/test/jpush/exam/config.php
Fatal error: Uncaught JPush\Exceptions\APIRequestException – [404]: request api doesn’t exist thrown in /phpstudy/www/test/jpush/src/JPush/Http.php on line 130
这个是什么问题???


#2

根据错误检查下这一行


(大白菜) #3

image但是上面已经引用了啊


#4

需要包含 device API
参考 example


(大白菜) #5

下载你的这个demo的话可以在本地测试吗?


#6

之前你用的不是官方 PHP SDK吗


可以看下 readme 的说明,example 示例修改部分参数后可以用


(大白菜) #7

我发现用你说的这个demo直接还是提示处错误了。Array ( [body] => Array ( [sendno] => 369113553 [msg_id] => 3401354454 ) [http_code] => 200 [headers] => Array ( [0] => HTTP/1.1 200 OK [Server] => nginx [Date] => Thu, 20 Dec 2018 10:08:26 GMT [Content-Type] => application/json [Content-Length] => 44 [Connection] => keep-alive [X-Rate-Limit-Limit] => 600 [X-Rate-Limit-Remaining] => 599 [X-Rate-Limit-Reset] => 60 [X-Jpush-Timestamp] => 1545300506514 ) ) JPush\Exceptions\APIRequestException – [1011]: cannot find user by this audience


#8