loginWithUser:用户到iOS的QBChat实例失败

时间:2013-03-29 23:52:48

标签: quickblox

当我托盘连接设备进行聊天时,成功登录后,响应为未授权。我在SDK附带的示例中编码。是:

-(void)completedWithResult:(Result *)result  context:(void *)contextInfo{


if([result isKindOfClass:[QBUUserLogInResult class]]){

    // Success result
    if(result.success){

        QBUUserLogInResult *res = (QBUUserLogInResult *)result;
        [self saveHostUser:res.user];
        [self loginResult:kLoggedOnline andErrorDescription:nil];

        // Login to Chat
        [QBChat instance].delegate = self;
        [[QBChat instance] loginWithUser:[[[UserService sharedInstance] hostUser] qbUser]];

        // Register as subscriber for Push Notifications
        [QBMessages TRegisterSubscriptionWithDelegate:nil];
    }
}

}

检索到的错误是:

error:
2013-03-29 16:51:37.201 App[2031:720f] didFailToRegisterForRemoteNotificationsWithError
2013-03-29 16:51:37.201 App[2031:680b] QBChat/xmppStreamDidNotAuthenticate: <failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><not-authorized></not-authorized></failure>
2013-03-29 16:51:37.201 App[2031:730b] redelegateBackCurrentApplication
2013-03-29 16:51:37.302 App[2031:720f] QBChat/xmppStreamDidDisconnect, error=(null)

因此,不会发送消息。有没有人知道我还需要什么比会话,登录,注册,获取用户。

1 个答案:

答案 0 :(得分:0)

您应该设置密码

res.user.password = @"yourpassword";
[self saveHostUser:res.user];