1

当我托盘连接设备进行聊天时,成功登录后,响应是未经授权的。我在 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)

因此,不会发送消息。有谁知道除了会话、登录、注册、获取用户之外我还需要什么。

4

1 回答 1

0

你应该设置密码

res.user.password = @"yourpassword";
[self saveHostUser:res.user];
于 2013-03-30T14:12:07.537 回答