I\'m using the Quickblox iOS SDK for instant messaging in my app. When a user logs in I retrieve the list of messages. I am trying to retrieve the last N messages. I use extende
I was getting the same issue in Android .
Solved it as following . All you have to do is add a parameter in requestbuilder sortDesc("date_sent");
QBDialog dlg=new QBDialog(str_dialogid);
QBRequestGetBuilder requestBuilder = new QBRequestGetBuilder();
requestBuilder.setLimit(10);
requestBuilder.sortDesc("date_sent");
//Try this out:
NSMutableDictionary *extendedRequest = [NSMutableDictionary new];
NSDate *now = [NSDate date];
extendedRequest[@"date_sent[lte]"]= @([now timeIntervalSince1970]);
extendedRequest[@"sort_desc"]= @"date_sent";
//get the most recent 50 messages
extendedRequest[@"limit"] = @(50);
[QBChat messagesWithDialogID:self.dialog.ID extendedRequest:extendedRequest delegate:self];