Search code examples
iphonechatquickblox

Quickblox Login name cannot displayed in the cell row


I have using Quickblox framework for chatting purpose.login value set to each cell.row. but some values displaying "0" in cell.row. I have attached the below images and shows login as a number and name. Below code the variable "testDict" return null value sometime.

    QBChatDialog *chatDialog = [ChatService shared].dialogs[idx];
    NSDictionary *testDict=[ChatService shared].usersAsDictionary[@(chatDialog.recipientID)];
    QBUUser *recipient = [ChatService shared].usersAsDictionary[@(chatDialog.recipientID)];
    NSString *test=recipient.login == nil ? (recipient.fullName == nil ? [NSString stringWithFormat:@"%lu", (unsigned long)recipient.ID] : recipient.fullName) : recipient.login;

    NSLog(@"DialogList:%@",testDict);

enter image description here


Solution

  • Finally i got the answer. just change the page:nil to page:[QBGeneralResponsePage responsePageWithCurrentPage:1 perPage:20]

    only get the 20 userlist display now

    -(void)requestDialogsWithCompletionBlock:(void(^)())completionBlock{
    
    self.getDialogsCompletionBlock = completionBlock;
    
    [QBRequest dialogsWithSuccessBlock:^(QBResponse *response, NSArray *dialogObjects, NSSet *dialogsUsersIDs) {
    
        self.dialogs = dialogObjects.mutableCopy;
    
    
        [QBRequest usersWithIDs:[dialogsUsersIDs allObjects] page:nil
                   successBlock:^(QBResponse *response, QBGeneralResponsePage *page, NSArray *users) {
    
    
                   } errorBlock:nil];
    
    } errorBlock:nil];
    }