Search code examples
iosquickblox

iOS QuickBlox SDK filtering custom objects by userID


I'm attempting to filter custom objects by a particular userID using the iOS6 SDK on an iPhone 4s running 6.0.1. Unfortunately when the code below is executed it returns all the records in the custom object schema that were created.

    NSMutableDictionary *getRequest = [NSMutableDictionary dictionary];
    [getRequest setObject:@"222222" forKey:@"user_id"];
    [QBCustomObjects objectsWithClassName:@"appointments" extendedRequest:getRequest delegate:self];

(i've omitted the authentication code. I am able to authenticate and create a record just fine) For the key i've tried every permutation I can think of for userID. Including looking at the response from the query request and how the field is referenced in the jSON feed. It's almost as if the extendedRequest isn't taking into account any values I put in there - but I clearly see them being passed when view the console logs.


Solution

  • I went back and looked at how I was creating a quickblox session and I was using the following method to authenticate with the API.

        [QBUsers logInWithUserEmail:@"" password:@"" delegate:self];
    

    I switched it to use this method instead and I am now able to pull specific records from the Custom Objects module.

        [QBAuth createSessionWithExtendedRequest:extendedAuthRequest delegate:self];