无法连接到 [QBChat 实例] 在 Quickblox 中与用户连接

Can't connect to [QBChat Instance] connect with User, in Quickblox

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

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

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

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

1.Make 确定你在 viewDidLod 中设置了委托方法,没有出现视图等等。例如:

- (void)viewDidLoad {
    [super viewDidLoad];

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

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

2.Make 确定你的调用方法是正确的。包含用户的数组不得等于 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. 检查视图布局、大小和宽度。确保它们设置正确。