function test_fetchMessageCount($userId) { $apiKey = $this->apiKey; $secretKey = $this->secretKey; $channel = new Channel($apiKey, $secretKey); $ret = $channel->fetchMessageCount($userId); if (false === $ret) { error_output('WRONG, ' . __FUNCTION__ . ' ERROR!!!!!'); error_output('ERROR NUMBER: ' . $channel->errno()); error_output('ERROR MESSAGE: ' . $channel->errmsg()); error_output('REQUEST ID: ' . $channel->getRequestId()); } else { right_output('SUCC, ' . __FUNCTION__ . ' OK!!!!!'); right_output('result: ' . print_r($ret, true)); } }
/** * 查询离线消息的个数 * @param type $paramArr */ public static function fetchMessageCount($paramArr) { $options = array('apiKey' => '', 'secretKey' => '', 'userId' => ''); if (is_array($paramArr)) { $options = array_merge($options, $paramArr); } extract($options); $channel = new Channel($apiKey, $secretKey); $ret = $channel->fetchMessageCount($userId); return $ret; }