功能描述
群成员资料相关方法在核心方法为
GroupGetMemberInfoList
和 GroupModifyMemberInfo
。获取群成员资料
您可以调用
GroupGetMemberInfoList
(点击查看详情) 获取群成员资料。该接口支持批量获取,您可以一次传入多个 group_get_members_info_list_param_identifier_array
获取多个群成员的资料,从而提升网络传输效率。示例代码如下:
// 获取群成员资料GroupGetMemberInfoListParam param = new GroupGetMemberInfoListParam{group_get_members_info_list_param_group_id = "group_id",group_get_members_info_list_param_identifier_array = new List<string>{"user_id"}};TIMResult res = TencentIMSDK.GroupGetMemberInfoList(param, (int code, string desc, GroupGetMemberInfoListResult result, string user_data)=>{// 处理异步逻辑});
修改群成员资料
群主或管理员可以调用
GroupModifyMemberInfo
(点击查看详情) 接口修改群成员的群名片(group_modify_member_info_name_card
)、自定义字段(group_modify_member_info_custom_info
)等与群成员相关的资料。示例代码如下:
// 设置群成员资料GroupModifyMemberInfoParam param = new GroupModifyMemberInfoParam{group_modify_member_info_group_id = "group_id",group_modify_member_info_identifier = "userB",group_modify_member_info_modify_flag = TIMGroupMemberModifyInfoFlag.kTIMGroupMemberModifyFlag_NameCard,group_modify_member_info_name_card = "new name card"};TIMResult res = TencentIMSDK.GroupModifyMemberInfo(param, (int code, string desc, string user_data)=>{// 处理异步逻辑});