iOS Quickblox错误:请求失败:未经授权(401)

时间:2018-07-17 10:27:37

标签: ios objective-c iphone chat quickblox

最近2天我一直在进行quickblox框架集成,我点击https://quickblox.com/developers/IOS链接进行集成,但是很遗憾 我停止在注册用户步骤

注册代码

QBUUser *user=[[QBUUser alloc] init];
user.login=@"abc";
user.password=@"12345678";

[QBRequest signUp:user successBlock:^(QBResponse * _Nonnull response, QBUUser * _Nonnull tUser) {
                NSLog(@"Successfully signup:-%@",tUser);
            } errorBlock:^(QBResponse * _Nonnull response) {
                NSLog(@"Error in signup:- %@",response);
            }];

每次都会返回

error: Request failed: unauthorized (401)
reasons: {
    errors =     {
        base =         (
            "Required session does not exist"
        );
    };
}

请任何人有解决方案,然后帮助我

预先感谢

1 个答案:

答案 0 :(得分:0)

这是(Swift 4)的工作代码

let user = QBUUser()
user.login = "abc"
user.password = "12345678"

QBRequest.signUp(user, successBlock: { response, tUser in
    print("Successfully signup:-\(tUser)")
}, errorBlock: { response in
    print("Error in signup:- \(response)")
})

输出:

enter image description here