Retrieve Records from Quickblox API

孤人 提交于 2019-12-13 07:13:15

问题


I am using Quickblox SDK in my Application and designed Custom Objects in the Quickblox Admin panel.Here i am having some complex relationship between Custom Objects and not able to figure out how to retrieve the records using the Quickblox API.

Problem:

There are two tables 1.User 2.Group, i am successfully fetching all the groups created by a specific using by using parent_id key as mention in Quickblox API for maintaining relationships between tables.

I want to retrieve all the groups created by the user and also the groups in which the user is added as a member which are created by other Users.How can i solve this? In my group table i am having a column that is an array of userIds to represent all the group members.

Can anyone tell me how to resolve this.How i can query and retrieve.I am really poor at DB knowledge and moreover Quickblox is a having different approach in the DB Design.


回答1:


NSMutableDictionary *getRequest = [NSMutableDictionary dictionary];    
[getRequest setObject:user_id forKey:@“user_ids_column_name[in]"];
[getRequest setObject:user_id forKey:@"ParentID"];


    QBRequestErrorBlock errorBlock = ^(QBResponse *response) {

        NSLog(@"error: %@", response.error);

    };

    [QBRequest objectsWithClassName:@“Group” extendedRequest:getRequest successBlock:^(QBResponse *response, NSArray *objects, QBResponsePage *page){


        NSLog(@"Success");


    } errorBlock:errorBlock];


来源:https://stackoverflow.com/questions/36855064/retrieve-records-from-quickblox-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!