Question

Can users be sorted in Paged Requests similar to Custom Objects when using Quickblox?

For example, I am hoping to be able to sort users by last requests. The idea is that the user can find all users who say like "dogs" and then get a list of the users who have used the app most recently first.

Using Custom objects, I can use sort_asc=field_name and sort_desc=field_name parameters. I have looked through the documentation and have failed to find anything suggesting that this is possible for users.

Am I missing something, or does anyone have a suggestion on how I should go about this?

Thank you for your time.

Was it helpful?

Solution

Yes, you can use order parameter in GET Users query

http://quickblox.com/developers/Users#Sort

For example, you would like to sort users by last_request_at field:

https://api.quickblox.com/users.xml?order=asc%20date%20last_request_at

iOS SDK way:

NSMutableDictionary *filters = [NSMutableDictionary dictionary];
filters[@"order"] = @"desc date last_request_at";
// filters[@"filter[]"] = @"number id in 1,3,4";
[QBUsers usersWithExtendedRequest:filters delegate:self];
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top