我需要通过 PHP 获取推送收件人的数量。所以我尝试“查询”安装(集合)但没有成功。有什么提示或解决方法吗?我是 Parse.com 的新用户,谢谢。
出现这个错误:
Parse\ParseException: Clients aren't allowed to perform the find operation on the installation collection.
这是我的代码
// Initialisation
require_once('parse_sdk/autoload.php');
Parse\ParseClient::initialize($ws_push_APPLICATION_ID, $ws_push_REST_API_KEY, $ws_push_MASTER_KEY);
$query = new Parse\ParseQuery("_Installation");
$results = $query->find();
有什么建议吗?
最佳答案
ParseClient 有一个 _request() 方法。传递 true 作为最后一个参数以使用 Parse 主 key 。您需要使用主 key 才能查询安装。
// Count no. of installations
$queryString = http_build_query( array('limit'=>0, 'count'=>1, 'where'=>'{"appName":"myAppName"}') );
$result = ParseClient::_request('GET',
'/1/installations'.
'?' . $queryString, null, null, true);
return $result['count'];
关于php - 如何获取安装(收藏)数量?获取推送接收者的数量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26391890/