iOS Live SDK Login Chat Failure
Updated: 2023-03-26 20:05:59
Problem Description
When logging into a live room using the iOS Live SDK, custom audience login information is supported, but it may cause chat room login failure. The configuration code and specific symptoms are as follows:
[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];
}];
- In the cloud classroom scenario, PPT fails to load.
- Chat interaction messages cannot be received or sent.
- Interactive features (tips, surveys, answer sheets, announcements, etc.) are unavailable.
- After the host initiates a co-hosting request, the co-hosting button does not appear.
Solution and Troubleshooting Approach
- viewerId: Must be a valid string. Empty strings such as
@"",nil, ornullare not allowed. - viewerName: Must be valid characters. Empty strings such as
@"",nil, ornullare not allowed, and prohibited words must be avoided. - viewerAvatar: Must be valid characters. Empty strings such as
@"",nil, ornullare not allowed, and the image resource must exist and be accessible. - It is recommended to perform validation when customizing user login information. If invalid data is detected, simply skip the customization. In this case, the Live SDK will use default values, which will not affect chat room login.
