2
我想從對話框中只讀未讀消息列表(不計數)。 QuickBlox文檔中沒有這樣的請求。這是我的功能,但它沒有返回值:quickblox php獲取未讀消息列表
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);
}