更新时间:2024-07-30 GMT+08:00
联系人UI定制
openContactSelectPage:scene:completeHander:
接口描述
该接口用于定制打开联系人选择页面。
图1 生效后拦截SDK选择联系人界面
注意事项
- 如果自定义需要自己构建加人UI界面,组装添加人员数组。
方法定义
1 2 3 |
- (void)openContactSelectPage:(NSArray<HWMConfContactModel *> *)param scene:(HWMSelectedContactScene)scene completeHander:(void(^)(NSArray<HWMContactSelectedModel *> *result, NSError *error))handler; |
参数描述
无
返回值
无
示例代码
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
/// 定制打开联系人选择页面 - (void)openContactSelectPage:(NSArray<HWMConfContactModel *> *)param scene:(HWMSelectedContactScene)scene completeHander:(void(^)(NSArray<HWMContactSelectedModel *> *result, NSError *error))handler { NSLog(@"enter open contact select page"); ContactSelectViewController * contactSelectVc = [[ContactSelectViewController alloc] initWithResultHandler:handler]; [self pushViewControllerWithVc:contactSelectVc]; } /// 模拟回调添加与会者人员 - (void)initSlectedModels { NSMutableArray *slectedModels = [NSMutableArray array]; HWMContactSelectedModel *model = [[HWMContactSelectedModel alloc] initWithName:@"测试账号01" number:@"" contactType:HWMContactTypeEnterprise]; [slectedModels addObject:model]; HWMContactSelectedModel *model2 = [[HWMContactSelectedModel alloc] initWithName:@"测试账号02" number:@"" contactType:HWMContactTypeEnterprise]; [slectedModels addObject:model2]; HWMContactSelectedModel *model3 = [[HWMContactSelectedModel alloc] initWithName:@"测试账号03" number:@"" contactType:HWMContactTypeEnterprise]; [slectedModels addObject:model3]; HWMContactSelectedModel *model4 = [[HWMContactSelectedModel alloc] initWithName:@"测试账号04" number:@"" contactType:HWMContactTypeEnterprise]; [slectedModels addObject:model4]; /// AppId 接入场景示例代码 HWMContactSelectedModel *model5 = [[HWMContactSelectedModel alloc] initWithName:@"测试账号05" number:@"" contactType:HWMContactTypeEnterprise]; model5.thirdUserId = getThirdUserId(); [slectedModels addObject:model5]; self.completeHandler(slectedModels, nil); } |
1.AppId 登录场景建议使用自定义联系人及 UI ,构建选中联系人数据时,需要传入第三方账号 thirdUserId。
2.completeHander直接回调需要添加的人员数组,如果不需要UI界面,可根据需求直接回调相关数据。
3.initSlectedModels为模拟测试数据,接入时需要传入真实数据。
父主题: 界面定制