QuickBlox / quickblox-ios-sdk

QuickBlox iOS SDK for messaging and video calling
https://quickblox.com/developers/IOS
MIT License
396 stars 358 forks source link

Error: Can't retrieve users from any way #834

Closed Nik20112 closed 7 years ago

Nik20112 commented 7 years ago

Help avoid duplicate issue reports, check existing issues

Environment details iOS version, Quickblox iOS SDK version, QuickbloxWebRTC SDK version (optional) iOS Version: 10.3 pod 'Quickblox-WebRTC', '~> 2.6' pod 'QuickBlox'

Did this work before? No. I am working on Swift 3 I have successfully sign up and login with QuickBlox. I want to retrieve users by tags but I can't retrieve it. Also, tried with users by Ids, all users but its failed and not received any error from QBRequest. Already checked "Allow to retrieve a list of users" in Setting in Admin Panel.

//login in QuickBlox

    let user:QBUUser = QBUUser()
    user.password = self.txtPassword.text
    user.email = self.txtUsername.text
    user.fullName = userResponse.value(forKey: "name") as! String
    user.login = kLoginName
    user.tags = [kRoomName]

    QBRequest.logIn(withUserEmail: self.txtUsername.text!, password: self.txtPassword.text!, successBlock: { (response:QBResponse, user:QBUUser?) in
        debugPrint(response.status)
        debugPrint(user)
        if response.isSuccess{
            let dict:NSMutableDictionary = userResponse.mutableCopy() as! NSMutableDictionary
            dict.setValue(user, forKey: kQBUSER)

            let currentUser = UserModal(fromDictionary: dict)
            let userData = NSKeyedArchiver.archivedData(withRootObject: currentUser.toDictionary())
            MyUserDefaults.setValue(userData, forKey: kCurrentUser)
            AppDelegate.singleton.iSUpdateProfile = true;

            let controller = NavigationManager.singleton.screen(screenType: NavigationScreenType.Friend) as! FriendVC
            self.navigationController?.pushViewController(controller, animated: true)
        }
        else{
            messageBox(message: response.error?.description)
        }
    }) { (response:QBResponse) in
        debugPrint("Error to register in Quickblox-----",response.error?.description)
        messageBox(message: response.error?.description)

    }

Expected behavior I think it should be working fine but its not so please resolve it or guide me what is wrong in my code?

Actual behavior Its not working while retrieve users from tags, Ids, and all users itself.

Logs Attach full logs that will describe your problem (please, use github gist) I don't see any logs even logs is enable in code. QBSettings.setLogLevel(QBLogLevel.errors)

Steps to reproduce the behavior //Retrieve users with IDs

QBRequest.users(withIDs: ["29945208"], page: QBGeneralResponsePage.init(currentPage: 1, perPage: 1), successBlock: { (response:QBResponse, responsePage:QBGeneralResponsePage, qbuserdata:[QBUUser]) in debugPrint("Success",response); debugPrint(responsePage); debugPrint(qbuserdata)

    } as? (QBResponse, QBGeneralResponsePage?, [QBUUser]?) -> Void) { (response:QBResponse) in 
       messageBox(message: response.error?.description)            
    }

//Retrieve all users

    QBRequest.users(for: QBGeneralResponsePage.init(currentPage: 1, perPage: 10), successBlock: { (response:QBResponse, responsePage:QBGeneralResponsePage, qbuserdata:[QBUUser]) in
        debugPrint("Success",response);
        debugPrint(responsePage);
        debugPrint(qbuserdata)

    } as? (QBResponse, QBGeneralResponsePage?, [QBUUser]?) -> Void) { (response:QBResponse) in
        messageBox(message: response.error?.description)
    }

//Retrieve all users by tags

    QBRequest.users(withTags: currentUser?.qbuser.tags as! [String], page: QBGeneralResponsePage.init(currentPage: 1, perPage: 1), successBlock: { (response:QBResponse, responsePage:QBGeneralResponsePage, qbuserdata:[QBUUser]) in if response.isSuccess{
            debugPrint("Success",response);
            debugPrint(responsePage);
            debugPrint(qbuserdata)
        }
        else{
            messageBox(message: response.error?.description)
        }

    } as? (QBResponse, QBGeneralResponsePage?, [QBUUser]?) -> Void) { (response:QBResponse) in
        messageBox(message: response.error?.description)
    }

Any others comments? Please resolve this issue asap.

Raikerian commented 7 years ago

Hi,

Please set log level Debug and post full logs for this.

ghost commented 7 years ago

Hi @Nik20112, Any updates ?

RatneshRa commented 6 years ago

Hi Please Help me I have create quickblox login and create session in ios(swift4) but response is error: Request failed: client error (422) reasons: { errors = ( "User's email unconfirmed" ); } thanks