I am using quickblox in my app
I am trying to retrieve a dialog with certain user IDs
NSMutableDictionary *dict = [[NSMutableDictionary alloc]init];
[dict setObject:@"occupants_ids" forKey:@[@([[[DataManager sharedCenter]chat_user]ID]), @(self.opponent.ID)]];
[QBChat dialogsWithExtendedRequest:dict delegate:self];
and the result is this:
2014-08-09 13:47:02.843 App New[8752:8e0b] Performing async request:
GET https://api.quickblox.com/chat/Dialog.xml
headers:{
"QB-SDK" = "iOS 1.9.1";
"Qb-Token" = verylongtokencensored;
"QuickBlox-REST-API-Version" = "0.1.1";
}
parameters:{
(
1434093,
1367118
) = "occupants_ids";
}
2014-08-09 13:47:02.848 App New[8752:8e0b] Request finished, response:
headers:{
"Access-Control-Allow-Origin" = "*";
"Cache-Control" = "max-age=0, private, must-revalidate";
Connection = "keep-alive";
"Content-Type" = "application/xml; charset=utf-8";
Date = "Sat, 09 Aug 2014 10:47:02 GMT";
Etag = "\"0c1aa29ff51b425a9be969d4fbb487a1\"";
"QB-Token-ExpirationDate" = "2014-08-09 12:47:02 UTC";
"QuickBlox-REST-API-Version" = "0.1.1";
Server = "nginx/1.0.15";
Status = "201 Created";
"Transfer-Encoding" = Identity;
"X-Rack-Cache" = "invalidate, pass";
"X-Request-Id" = 2330d50ea8c08851cafd30ea4c1a1c6b;
"X-Runtime" = "0.022278";
"X-UA-Compatible" = "IE=Edge,chrome=1";
}
body:
<?xml version="1.0" encoding="UTF-8"?>
<session>
<_id>53e5fc26535c12a2f700aa3c</_id>
<application-id type="integer">10910</application-id>
<created-at type="datetime">2014-08-09T10:47:02Z</created-at>
<device-id type="integer">0</device-id>
<nonce type="integer">399</nonce>
<token>verylongtokencensored</token>
<ts type="integer">1407581207</ts>
<updated-at type="datetime">2014-08-09T10:47:02Z</updated-at>
<user-id type="integer">1434093</user-id>
<id type="integer">54616</id>
</session>
error:
2014-08-09 13:47:02.852 App New[8752:60b] received result:QBDialogsPagedResult,success:0,status:0
2014-08-09 13:47:02.852 App New[8752:8e0b] Request finished, response:
headers:(null)
body:
error:
2014-08-09 13:47:02.853 App New[8752:60b] Errors=(
"Connection closed due to timeout. Please check your internet connection."
)
How do i fix this error ?
Other requests sent to the api, which is not /chat/Dialog.xml they work fine, no connection timeout error
The right way is to use filter all:
[dict setObject:@"33,55" forKey:@"occupants_ids[all]"];
this will found all the dialogs where occupants_ids = "33,55"
you also can use filter in:
[dict setObject:@"33" forKey:@"occupants_ids[in]"];
this will return all the dialogs where occupants_ids contains 33