php - 如何获取安装(收藏)数量?获取推送接收者的数量

标签 php push-notification parse-platform

我需要通过 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/

相关文章:

php - Laravel Observer 创建工作但删除不工作

php - 如何在 wordpress 中为多个 meta_key 更新用户元数据

javascript - jQuery 验证插件和输入文件的问题

javascript - 如何使用 Parse.com Cloudcode 发送推送通知

java - 从 edittext Android 识别电子邮件

php - 如果mysql表中user_id不存在,如何插入新数据

javascript - Vue.js:如何在已打开的选项卡中打开外部链接?

push-notification - firebase 是否处理推送通知?

iphone - 推送通知未出现在通知托盘中

ios - 代码 : Return a Float from an NSMutableArray in heightForCellAtIndexPath