【问题标题】:Can't connect to [QBChat Instance] connect with User, in Quickblox无法在 Quickblox 中连接到 [QBChat Instance] 与用户连接
【发布时间】:2015-12-08 22:54:47
【问题描述】:

我正在使用 Quickblox Api 进行聊天和视频聊天。 IOS。我正在使用最新版本的 API

当我尝试进行视频通话时, 大多数时候我没有视频,只有音频。 我在 15 次中得到 1 次两端的视频。 10 次视频中有 3 次在一端。

很奇怪。我有良好的互联网连接。连接到聊天用户正在接听电话。似乎可以找出问题所在。

【问题讨论】:

标签: chat quickblox


【解决方案1】:

花了一些时间找到问题后,我收到了 Quickblox 帮助中心的帮助。 如果你在 API 上遇到这样的行为

1.确保您在 viewDidLod 中设置了委托方法,而不是视图确实出现了等等。例如:

- (void)viewDidLoad {
    [super viewDidLoad];

    [[QBChat instance] addDelegate:self];
    [QBRTCClient.instance addDelegate:self];
    [QBSettings setCarbonsEnabled:YES];
}

在您拨打或接听电话后,使用断点确定它们是否被调用。

2.确保您的调用方法正确。包含用户的数组不得等于 currentUser.ID。

NSInteger currentUserID = [QBSession currentSession].currentUser.ID;
    int count = 0;

NSNumber *currentUserIndex = nil;
for (NSNumber *opponentID in opponentsIDs) {
    if ([opponentID integerValue] == currentUserID) {
        currentUserIndex = @(count);
        break;
    }
    count++;
}
if (currentUserIndex) [opponentsIDs removeObjectAtIndex:[currentUserIndex intValue]];
QBRTCSession *session = [QBRTCClient.instance createNewSessionWithOpponents:opponentsIDs
                                                         withConferenceType:QBRTCConferenceTypeVideo];
NSDictionary *userInfo = @{ @"key" : @"value" };
[session startCall:userInfo];
if (session) {
    self.currentSession = session;
    [self performSegueWithIdentifier:@"openDialogSeg" sender:self];
}
else {
    [SVProgressHUD showErrorWithStatus:@"You should login to use chat API. Session hasn’t been created. Please try to relogin the chat."];
}

}

  1. 检查视图布局、大小和宽度。确保它们设置正确。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-05-04
    • 1970-01-01
    • 1970-01-01
    • 2012-02-03
    相关资源
    最近更新 更多