我试图从对话框中仅获取未读消息列表(不计数)。QuickBlox 的文档中没有这样的要求。这是我的函数,但它什么也不返回:
function getUnreadMessages($login, $password, $dialogId, $userId) {
$session = quickCreateSession($login, $password);
$token = $session->token;
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://api.quickblox.com/chat/Message.json?chat_dialog_id=' . $dialogId . '&read_ids[nin]=' . $userId );
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'QuickBlox-REST-API-Version: 0.1.0',
'QB-Token: ' . $token
));
$response = curl_exec($curl);
if ($response) {
return @iconv("ISO-8859-9//TRANSLIT", "UTF-8", $response);
} else {
return false;
}
@curl_close($curl);
}