iOS直播SDK登录聊天失败

问题描述

iOS直播SDK登录直播间时,支持自定义观众登录信息,可能导致聊天室登录失败,配置代码及具体表现如下:

[PLVRoomLoginClient loginLiveRoomWithChannelType:channelType
                                           channelId:self.channelIdTF.text
                                              userId:self.userIDTF.text
                                               appId:self.appIDTF.text
                                           appSecret:self.appSecretTF.text
                                            roomUser:^(PLVRoomUser * _Nonnull roomUser) {
        // 可在此处配置自定义的登陆用户ID、昵称、头像,不配则均使用默认值
        // roomUser.viewerId = @"用户ID";
        // roomUser.viewerName = @"用户昵称";
        // roomUser.viewerAvatar = @"用户头像";
    } completion:^(PLVViewLogCustomParam * _Nonnull customParam) {
        [hud hideAnimated:YES];
        [weakSelf saveParamsToFile];
        
        if (successHandler) {
            successHandler();
        }
    } failure:^(NSString * _Nonnull errorMessage) {
        [hud hideAnimated:YES];
        [weakSelf showHud:errorMessage detail:nil];
    }];
  1. 云课堂场景,PPT加载失败

  2. 聊天互动消息无法接收与发送

  3. 互动相关功能(打赏、问卷、答题卡、公告等)无法使用

  4. 主讲发起连麦后,不显示连麦按钮

解决方案与排查思路

  1. viewerId: 需为合法字符串。不可出现空串 @""、nil、null等

  2. viewerName: 需为合法字符。不可出现空串 @""、nil、null等,并需要规避严禁词

  3. viewerAvatar: 需为合法字符。不可出现空串 @""、nil、null等,并需确认该图片资源是存在且可访问

  4. 建议自定义登录用户信息时,做合法判断,出现非法情况时,则不进行自定义操作即可,此时,直播SDK会使用默认值,不会影响聊天室登录

Last updated

Was this helpful?