群相关接口

更新时间: 2024/08/12 14:47:11

群相关接口提供聊天群组相关业务逻辑功能。

TeamRepo 类

//chatkit/com.netease.yunxin.kit.chatkit.repo/TeamRepoTeamKit-ui 模块中业务提供群组相关接口,根据业务需求对 SDK 接口进行组合封装。

方法列表

接口 接口原型 接口描述
addManagers addManagers(teamId: String, teamType: V2NIMTeamType, members: List<String>, callback: FetchCallback<Void>?) 添加管理员,添加用户必须为群成员。
addTeamListener addTeamListener(listener: V2NIMTeamListener) 添加群组监听。
createTeam createTeam(param: V2NIMCreateTeamParams, members: List<String>, postscript: String? = null, antispamConfig: V2NIMAntispamConfig? = null, callback: FetchCallback?) 创建群。
dismissTeam dismissTeam(teamId: String, teamType: V2NIMTeamType, callback: FetchCallback<Void>?) 解散群,只有创建者有此权限。
getTeamInfo getTeamInfo(teamId: String, callback: FetchCallback?) 查询群资料。
getTeamList getTeamList(callback: FetchCallback<List>) 获取我的群组列表。
getTeamManagerCount getTeamManagerCount(teamId: String, teamType: V2NIMTeamType, callback: FetchCallback<Int>?) 查询群组中,管理员数量,包括群主和管理员。
getTeamMember getTeamMember(teamId: String, teamType: V2NIMTeamType, accId: String, callback: FetchCallback<V2NIMTeamMember?>?) 查询群组中用户的资料。
getTeamMemberList getTeamMemberList(teamId: String, teamType: V2NIMTeamType, callback: FetchCallback?) 查询群组中,用户列表。
getTeamMemberListWithUserInfo getTeamMemberListWithUserInfo(teamId: String, cursor: String? = null, limit: Int? = 150, queryType: V2NIMTeamMemberRoleQueryType? = V2NIMTeamMemberRoleQueryType .V2NIM_TEAM_MEMBER_ROLE_QUERY_TYPE_ALL, callback: FetchCallback<TeamMemberListResult>?) 查询群组中,用户列表,查询结果中包含群中成员信息(V2NIMTeamMember)和用户信息(V2NIMUser)。
getTeamMemberListWithUserInfoByIds getTeamMemberListWithUserInfoByIds(teamId: String, teamType: V2NIMTeamType, accIds: List<String>, callback: FetchCallback<List<TeamMemberWithUserInfo>>?) 通过用户 ID 获取群成员信息,包括用户信息 在主线程中回调。
getTeamWithMember getTeamWithMember(teamId: String, accId: String, callback: FetchCallback<TeamWithCurrentMember>?) 查询群组中用户的资料,用于群设置同时查询群信息和某个群成员信息。
inviteTeamMembers inviteTeamMembers(teamId: String, teamType: V2NIMTeamType, members: List<String>, callback: FetchCallback<List<String>>?) 邀请用户入群。
leaveTeam leaveTeam(teamId: String, teamType: V2NIMTeamType, callback: FetchCallback<Void>?) 退出群。
queryAllTeamMemberListWithUserInfo queryAllTeamMemberListWithUserInfo(teamId: String, teamType: V2NIMTeamType? = V2NIMTeamType.V2NIM_TEAM_TYPE_NORMAL, callback: FetchCallback<List<TeamMemberWithUserInfo>>?) 查询所有群组中,用户列表,查询结果中包含群中成员信息(V2NIMTeamMember)和用户信息(V2NIMUser) 查询群成员和用户信息,分页查询,每次查询最多 150 个(受限于用户信息查询接口大小限制)。
removeManagers removeManagers(teamId: String, teamType: V2NIMTeamType, members: List<String>, callback: FetchCallback<Void>?) 批量移出群管理员,只有创建者有此权限。
removeTeamListener removeTeamListener(listener: V2NIMTeamListener) 移除群组监听。
removeTeamMembers removeTeamMembers(teamId: String, teamType: V2NIMTeamType, members: List<String>, callback: FetchCallback<Void>?) 批量移出群成员,只有创建者有此权限。
setTeamChatBannedMode setTeamChatBannedMode(teamId: String, teamType: V2NIMTeamType, bannedMode: V2NIMTeamChatBannedMode, callback: FetchCallback<Void>?) 对整个群禁言、解除禁言,根据 V2NIMTeamChatBannedMode 值设置禁言或取消禁言。
setTeamMuteStatus setTeamMuteStatus(teamId: String, teamType: V2NIMTeamType, muteMode: V2NIMTeamMessageMuteMode, callback: FetchCallback<Void>?) 设置会话免打扰。
transferTeam transferTeam(teamId: String, teamType: V2NIMTeamType, account: String, quit: Boolean, callback: FetchCallback<Void>?) 转让群。
updateInviteMode updateInviteMode(teamId: String, teamType: V2NIMTeamType, mode: V2NIMTeamInviteMode, callback: FetchCallback<Void>?) 更新群邀请模式,只用于高级群。
updateMemberNick updateMemberNick(teamId: String, teamType: V2NIMTeamType, accId: String, nickName: String, callback: FetchCallback<Void>?) 更新群中,用户的昵称,只用于高级群。
updateTeamExtension updateTeamExtension(teamId: String, teamType: V2NIMTeamType, extension: String, callback: FetchCallback<Void>?) 更新群组扩展字段,只用于高级群。
updateTeamIcon updateTeamIcon(teamId: String, teamType: V2NIMTeamType, url: String, callback: FetchCallback<Void>?) 更新群头像,只用于高级群。
updateTeamInfoModel updateTeamInfoModel(teamId: String, teamType: V2NIMTeamType, mode: V2NIMTeamUpdateInfoMode, callback: FetchCallback<Void>?) 更新群资料修改模式,只用于高级群。
updateTeamIntroduce updateTeamIntroduce(teamId: String, teamType: V2NIMTeamType, introduce: String, callback: FetchCallback<Void>?) 更新群介绍,只用于高级群。
updateTeamName updateTeamName(teamId: String, teamType: V2NIMTeamType, name: String, callback: FetchCallback<Void>?) 更新群名,只用于高级群。
此文档是否对你有帮助?
有帮助
去反馈
  • TeamRepo 类
  • 方法列表