观看权限校验
所属类
类名 | 备注 |
---|---|
VHWebinarInfoData | 活动详情类 |
VHallChatDelegate 关于文档的代理方法
方法 | 方法描述 |
---|---|
requestWatchInitWebinarId | 获取活动详情 |
queryWatchAuthWithWebinarId | 检查活动设置的观看权限 |
checkWatchAuthWithWebinarId | 校验活动观看权限 |
检查活动设置的观看权限
+ (void)requestWatchInitWebinarId:(NSString *)webinarId
pass:(NSString *)pass
k_id:(NSString *)k_id
nick_name:(NSString *)nick_name
email:(NSString *)email
record_id:(NSString *)record_id
auth_model:(NSInteger)auth_model
complete:(void(^)(VHWebinarInfoData * webinarInfoData, NSError *error))complete;
请求字段说明
参数名称 | 是否必须 | 示例 | 备注 |
---|---|---|---|
webinarId | 是 | 123456789 | 活动 Id,必传 |
pass | 否 | xxxxxx | 活动如果有 k 值或密码,则需要传 |
k_id | 否 | asiod | 观看活动维度下 k 值的唯一 ID |
nick_name | 否 | 阿超 | 昵称 |
否 | e@vhall.com | 邮箱 | |
record_id | 否 | 123456789 | 回放 id 非必传 |
auth_model | 否 | 0 | 0 : 校验观看权限(默认) 1 : 不校验观看权限 |
complete | 返回数据 | webinarInfoData | 请求完成,包含数据详情和错误信息 |
检查活动设置的观看权限
+ (void)queryWatchAuthWithWebinarId:(NSString *)webinar_id
complete:(void(^)(NSString * type, BOOL authStatus, NSError *error))complete;
请求字段说明
参数名称 | 是否必须 | 示例 | 备注 |
---|---|---|---|
webinarId | 是 | 123456789 | 活动 Id,必传 |
complete | 返回值 | type : 1 需要密码 2 白名单校验 , authStatus : 校验权限 , error : 错误提示 |
校验活动观看权限
+ (void)checkWatchAuthWithWebinarId:(NSString *)webinar_id
type:(NSString *)type
verify_value:(NSString *)verify_value
complete:(void(^)(NSDictionary *responseObject, NSError *error))complete;
请求字段说明
参数名称 | 是否必须 | 示例 | 备注 |
---|---|---|---|
webinarId | 是 | 123456789 | 活动 Id,必传 |
type | 是 | 1 | 0:免费(默认),1:密码,2:白名单 |
verify_value | 是 | 123 | 密码、白名单参数 |
complete | 返回值 | complete: 请求完成,包含数据详情和错误信息 |
代码示例
- (void)clickEnterRoom {
__weak __typeof(self)weakSelf = self;
[VHWebinarInfoData queryWatchAuthWithWebinarId:self.activityTF.text complete:^(NSString *type, BOOL authStatus, NSError *error) {
// 先判断是否报错
if (error) {
[VHProgressHud showToast:error.domain];
return;
}
// 判断是否需要校验
if (authStatus) {
// 需要校验
weakSelf.type = type;
[weakSelf changeTextWithVerifyValue:@"对应type的值"];
// 判断校验类型
} else {
// 不需要校验
[weakSelf watchInit];
}
}];
}
- (void)changeTextWithVerifyValue:(NSString *)verifyValue
{
__weak __typeof(self)weakSelf = self;
// 先去校验观看权限,通过以后才可以请求
[VHWebinarInfoData checkWatchAuthWithWebinarId:self.activityTF.text type:self.type verify_value:verifyValue complete:^(NSDictionary *responseObject, NSError *error) {
// 有数据
if (responseObject) {
[weakSelf watchInit];
}
// 报错
if (error) {
[VHProgressHud showToast:error.domain];
}
}];
}
修改于 2025-05-27 11:59:31