NIMSDK-iOS
载入中...
搜索中...
未找到
<NIMTeamManager>协议 参考

#import <NIMTeamManagerProtocol.h>

类 <NIMTeamManager> 继承关系图:

构造函数

(nullable NSArray< NIMTeam * > *) - allMyTeams
 
(nullable NIMTeam *) - teamById:
 
(nullable NIMTeam *) - teamById2:
 
(BOOL) - isMyTeam:
 
(void) - createTeam:users:completion:
 
(void) - createTeam:completion:
 
(void) - dismissTeam:completion:
 
(void) - quitTeam:completion:
 
(void) - addUsers:toTeam:postscript:attach:completion:
 
(void) - kickUsers:fromTeam:completion:
 
(void) - updateTeamName:teamId:completion:
 
(void) - updateTeamAvatar:teamId:completion:
 
(void) - updateTeamJoinMode:teamId:completion:
 
(void) - updateTeamInviteMode:teamId:completion:
 
(void) - updateTeamBeInviteMode:teamId:completion:
 
(void) - updateTeamUpdateInfoMode:teamId:completion:
 
(void) - updateTeamUpdateClientCustomMode:teamId:completion:
 
(void) - updateTeamIntro:teamId:completion:
 
(void) - updateTeamAnnouncement:teamId:completion:
 
(void) - updateTeamCustomInfo:teamId:completion:
 
(void) - updateTeamInfos:teamId:completion:
 
(void) - applyToTeam:message:completion:
 
(void) - passApplyToTeam:userId:completion:
 
(void) - rejectApplyToTeam:userId:rejectReason:completion:
 
(void) - updateUserNick:newNick:inTeam:completion:
 
(void) - updateMyCustomInfo:inTeam:completion:
 
(void) - addManagersToTeam:users:completion:
 
(void) - removeManagersFromTeam:users:completion:
 
(void) - transferManagerWithTeam:newOwnerId:isLeave:completion:
 
(void) - acceptInviteWithTeam:invitorId:completion:
 
(void) - rejectInviteWithTeam:invitorId:rejectReason:completion:
 
(void) - updateNotifyState:inTeam:completion:
 
(NIMTeamNotifyState- notifyStateForNewMsg:
 
(void) - updateMuteState:userId:inTeam:completion:
 
(void) - updateMuteState:inTeam:completion:
 
(void) - fetchTeamMembers:completion:
 
(void) - fetchTeamMutedMembers:completion:
 
(void) - getTeamMemberList:option:completion:
 
(void) - fetchTeamMembersFromServer:completion:
 
(void) - fetchInviterAccids:withTargetMembers:completion:
 
(void) - fetchTeamInfo:completion:
 
(nullable NIMTeamMember *) - teamMember:inTeam:
 
(void) - searchTeamWithOption:completion:
 
(BOOL) - updateTInfosLocal:
 
(void) - fetchTeamsWithTimestamp:completion:
 
(void) - fetchTeamInfoList:completion:
 
(void) - addTeamMembersFollow:accoutIds:completion:
 
(void) - removeTeamMembersFollow:accoutIds:completion:
 
(void) - addDelegate:
 
(void) - removeDelegate:
 

详细描述

群组协议

函数文档

◆ acceptInviteWithTeam:invitorId:completion:

- (void) acceptInviteWithTeam: (NSString *)  teamId
invitorId: (NSString *)  invitorId
completion: (nullable NIMTeamHandler completion 

接受入群邀请

参数
teamId群组ID
invitorId邀请者ID
completion完成后的回调

◆ addDelegate:

- (void) addDelegate: (id< NIMTeamManagerDelegate >)  delegate

添加群组委托

参数
delegate群组委托

◆ addManagersToTeam:users:completion:

- (void) addManagersToTeam: (NSString *)  teamId
users: (NSArray< NSString * > *)  users
completion: (nullable NIMTeamHandler completion 

添加管理员

参数
teamId群组ID
users需要添加为管理员的用户ID列表
completion完成后的回调

◆ addTeamMembersFollow:accoutIds:completion:

- (void) addTeamMembersFollow: (NSString *)  teamId
accoutIds: (NSArray< NSString * > *)  accoutIds
completion: (nullable NIMTeamHandler completion 

群成员添加特别关注

参数
teamId群组ID
accoutIds群成员id
completion完成后的回调

◆ addUsers:toTeam:postscript:attach:completion:

- (void) addUsers: (NSArray< NSString * > *)  users
toTeam: (NSString *)  teamId
postscript: (nullable NSString *)  postscript
attach: (nullable NSString *)  attach
completion: (nullable NIMTeamMemberHandler completion 

邀请用户入群

参数
users用户ID列表
teamId群组ID
postscript邀请附言
attach扩展消息
completion完成后的回调

◆ allMyTeams

- (nullable NSArray< NIMTeam * > *) allMyTeams

获取所有群组

返回
返回所有群组

◆ applyToTeam:message:completion:

- (void) applyToTeam: (NSString *)  teamId
message: (NSString *)  message
completion: (nullable NIMTeamApplyHandler completion 

群申请

参数
teamId群组ID
message申请消息
completion完成后的回调

◆ createTeam:completion:

- (void) createTeam: (NIMCreateTeamExOption *)  option
completion: (nullable NIMTeamCreateHandler completion 

创建群组

参数
option创建群选项
completion完成后的回调

◆ createTeam:users:completion:

- (void) createTeam: (NIMCreateTeamOption *)  option
users: (NSArray< NSString * > *)  users
completion: (nullable NIMTeamCreateHandler completion 

创建群组

参数
option创建群选项
users用户Accid列表
completion完成后的回调
弃用:
使用createTeam:completion:

◆ dismissTeam:completion:

- (void) dismissTeam: (NSString *)  teamId
completion: (nullable NIMTeamHandler completion 

解散群组

参数
teamId群组ID
completion完成后的回调

◆ fetchInviterAccids:withTargetMembers:completion:

- (void) fetchInviterAccids: (NSString *)  teamID
withTargetMembers: (NSArray< NSString * > *)  memberIDs
completion: (nullable NIMTeamFetchInviterAccidsHandler completion 

获取群成员邀请人Accid

参数
teamID群组ID
memberIDs查询的成员ID,数目不允许大于200
completion完成后的回调

◆ fetchTeamInfo:completion:

- (void) fetchTeamInfo: (NSString *)  teamId
completion: (nullable NIMTeamFetchInfoHandler completion 

获取群信息

参数
teamId群组ID
completion完成后的回调

◆ fetchTeamInfoList:completion:

- (void) fetchTeamInfoList: (NSArray< NSString * > *)  teamIds
completion: (NIMTeamFetchTeamInfoListHandler block 

获取指定群ID的群信息

参数
teamIds群ID列表,数组元素超过10个会取前10个
block完成后的回调 @discussion 从服务端全量拉取群信息,不做本地持久化

◆ fetchTeamMembers:completion:

- (void) fetchTeamMembers: (NSString *)  teamId
completion: (nullable NIMTeamMemberHandler completion 

获取群组成员

参数
teamId群组ID
completion完成后的回调 @discussion 绝大多数情况这个请求都是从本地读取缓存并同步返回,但是由于群成员信息量较大, SDK 采取的是登录后延迟拉取的策略 考虑到用户网络等问题, SDK 有可能没有及时缓存群成员信息,那么这个请求将是个带网络请求的异步操作(增量请求)。 同时这个接口会去请求本地没有缓存的群用户的资料信息,但不会触发 - (void)onUserInfoChanged: 回调。

◆ fetchTeamMembersFromServer:completion:

- (void) fetchTeamMembersFromServer: (NSString *)  teamId
completion: (nullable NIMTeamMemberHandler completion 

通过网络请求获取群组成员 *

参数
teamId群组ID
completion完成后的回调 @discussion 通过网络请求获取群成员列表,不同于fetchTeamMembers:completion这个接口是个必然带网络请求的异步操作(增量请求) 同时这个接口会去请求本地没有缓存的群用户的资料信息,但不会触发 - (void)onUserInfoChanged: 回调。

◆ fetchTeamMutedMembers:completion:

- (void) fetchTeamMutedMembers: (NSString *)  teamId
completion: (nullable NIMTeamMemberHandler completion 

获取群内被禁言的成员列表

参数
teamId群组ID
completion完成后的回调 @discussion 绝大多数情况这个请求都是从本地读取缓存并同步返回,但是由于群成员信息量较大, SDK 采取的是登录后延迟拉取的策略 考虑到用户网络等问题, SDK 有可能没有及时缓存群成员信息,那么这个请求将是个带网络请求的异步操作(增量请求)。 同时这个接口会去请求本地没有缓存的群用户的资料信息,但不会触发 - (void)onUserInfoChanged: 回调。

◆ fetchTeamsWithTimestamp:completion:

- (void) fetchTeamsWithTimestamp: (NSTimeInterval)  timestamp
completion: (nullable NIMTeamFetchTeamsHandler block 

获取所有群信息

参数
timestamp0表示全量获取群信息
block完成后的回调 @discussion 从服务端全量拉取群信息,并做本地持久化

◆ getTeamMemberList:option:completion:

- (void) getTeamMemberList: (NSString *)  teamId
option: (NIMTeamMemberRoleTypeSearchOption *)  option
completion: (nullable NIMTeamMemberSearchResultHandler completion 

群成员类型查询成员列表

参数
teamId群组ID
option搜索配置
completion完成后的回调

◆ isMyTeam:

- (BOOL) isMyTeam: (NSString *)  teamId

根据群组ID判断是否是我所在的群

参数
teamId群组ID
返回
是否在此群组

◆ kickUsers:fromTeam:completion:

- (void) kickUsers: (NSArray< NSString * > *)  users
fromTeam: (NSString *)  teamId
completion: (nullable NIMTeamHandler completion 

从群组内移除成员

参数
users需要移除的用户ID列表
teamId群组ID
completion完成后的回调

◆ notifyStateForNewMsg:

- (NIMTeamNotifyState) notifyStateForNewMsg: (NSString *)  teamId

群通知状态

参数
teamId群Id
返回
群通知状态

◆ passApplyToTeam:userId:completion:

- (void) passApplyToTeam: (NSString *)  teamId
userId: (NSString *)  userId
completion: (nullable NIMTeamApplyHandler completion 

通过群申请

参数
teamId群组ID
userId申请的用户ID
completion完成后的回调

◆ quitTeam:completion:

- (void) quitTeam: (NSString *)  teamId
completion: (nullable NIMTeamHandler completion 

退出群组

参数
teamId群组ID
completion完成后的回调

◆ rejectApplyToTeam:userId:rejectReason:completion:

- (void) rejectApplyToTeam: (NSString *)  teamId
userId: (NSString *)  userId
rejectReason: (NSString *)  rejectReason
completion: (nullable NIMTeamHandler completion 

拒绝群申请

参数
teamId群组ID
userId申请的用户ID
rejectReason拒绝理由
completion完成后的回调

◆ rejectInviteWithTeam:invitorId:rejectReason:completion:

- (void) rejectInviteWithTeam: (NSString *)  teamId
invitorId: (NSString *)  invitorId
rejectReason: (NSString *)  rejectReason
completion: (nullable NIMTeamHandler completion 

拒绝入群邀请

参数
teamId群组ID
invitorId邀请者ID
rejectReason拒绝原因
completion完成后的回调

◆ removeDelegate:

- (void) removeDelegate: (id< NIMTeamManagerDelegate >)  delegate

移除群组委托

参数
delegate群组委托

◆ removeManagersFromTeam:users:completion:

- (void) removeManagersFromTeam: (NSString *)  teamId
users: (NSArray< NSString * > *)  users
completion: (nullable NIMTeamHandler completion 

移除管理员

参数
teamId群组ID
users需要移除管理员的用户ID列表
completion完成后的回调

◆ removeTeamMembersFollow:accoutIds:completion:

- (void) removeTeamMembersFollow: (NSString *)  teamId
accoutIds: (NSArray< NSString * > *)  accoutIds
completion: (nullable NIMTeamHandler completion 

群成员移除特别关注

参数
teamId群组ID
accoutIds群成员id
completion完成后的回调

◆ searchTeamWithOption:completion:

- (void) searchTeamWithOption: (NIMTeamSearchOption *)  option
completion: (NIMTeamSearchHandler completion 

查询群信息

参数
option查询选项
completion完成回调 @discussion 返回本地缓存的群成员信息,如果本地没有相应数据则返回 nil。

◆ teamById2:

- (nullable NIMTeam *) teamById2: (NSString *)  teamId

根据群组 ID 获取具体的群组信息

参数
teamId群组 ID
返回
群组信息 @discussion 如果自己不在群里,则该接口返回 nil

◆ teamById:

- (nullable NIMTeam *) teamById: (NSString *)  teamId

根据群组 ID 获取具体的群组信息

参数
teamId群组 ID
返回
群组信息 @discussion 如果自己不在群里,则该接口返回 nil

◆ teamMember:inTeam:

- (nullable NIMTeamMember *) teamMember: (NSString *)  userId
inTeam: (NSString *)  teamId 

获取单个群成员信息

参数
userId用户ID
teamId群组ID
返回
返回成员信息 @discussion 返回本地缓存的群成员信息,如果本地没有相应数据则返回 nil。

◆ transferManagerWithTeam:newOwnerId:isLeave:completion:

- (void) transferManagerWithTeam: (NSString *)  teamId
newOwnerId: (NSString *)  newOwnerId
isLeave: (BOOL)  isLeave
completion: (nullable NIMTeamHandler completion 

移交群主

参数
teamId群组ID
newOwnerId新群主ID
isLeave是否同时离开群组
completion完成后的回调

◆ updateMuteState:inTeam:completion:

- (void) updateMuteState: (BOOL)  mute
inTeam: (NSString *)  teamId
completion: (nullable NIMTeamHandler completion 

禁言群全体成员

参数
mute是否禁言
teamId群组ID
completion经验操作完成后的回调 @discussion 操作成功后,云信服务器会下发禁言的群通知消息

◆ updateMuteState:userId:inTeam:completion:

- (void) updateMuteState: (BOOL)  mute
userId: (NSString *)  userId
inTeam: (NSString *)  teamId
completion: (nullable NIMTeamHandler completion 

群成员禁言

参数
mute是否禁言
userId用户ID
teamId群组ID
completion经验操作完成后的回调 @discussion 操作成功后,云信服务器会下发禁言的群通知消息

◆ updateMyCustomInfo:inTeam:completion:

- (void) updateMyCustomInfo: (NSString *)  newInfo
inTeam: (NSString *)  teamId
completion: (nullable NIMTeamHandler completion 

更新成员群自定义属性

参数
newInfo新的自定义属性
teamId群组ID
completion完成后的回调

◆ updateNotifyState:inTeam:completion:

- (void) updateNotifyState: (NIMTeamNotifyState state
inTeam: (NSString *)  teamId
completion: (nullable NIMTeamHandler completion 

修改群通知状态

参数
state群通知状态
teamId群组ID
completion完成后的回调

◆ updateTeamAnnouncement:teamId:completion:

- (void) updateTeamAnnouncement: (NSString *)  announcement
teamId: (NSString *)  teamId
completion: (nullable NIMTeamHandler completion 

更新群公告

参数
announcement群公告
teamId群组ID
completion完成后的回调

◆ updateTeamAvatar:teamId:completion:

- (void) updateTeamAvatar: (NSString *)  teamAvatarUrl
teamId: (NSString *)  teamId
completion: (nullable NIMTeamHandler completion 

更新群组头像

参数
teamAvatarUrl群组头像Url
teamId群组ID
completion完成后的回调

◆ updateTeamBeInviteMode:teamId:completion:

- (void) updateTeamBeInviteMode: (NIMTeamBeInviteMode beInviteMode
teamId: (NSString *)  teamId
completion: (nullable NIMTeamHandler completion 

更新群组被邀请人验证方式

参数
beInviteMode邀请方式
teamId群组ID
completion完成后的回调

◆ updateTeamCustomInfo:teamId:completion:

- (void) updateTeamCustomInfo: (NSString *)  info
teamId: (NSString *)  teamId
completion: (nullable NIMTeamHandler completion 

更新群自定义信息

参数
info群自定义信息
teamId群组ID
completion完成后的回调

◆ updateTeamInfos:teamId:completion:

- (void) updateTeamInfos: (NSDictionary< NSNumber *, NSString * > *)  values
teamId: (NSString *)  teamId
completion: (nullable NIMTeamHandler completion 

更新群信息

参数
values需要更新的群信息键值对
teamId群组ID
completion完成后的回调 @discussion 这个接口可以一次性修改群的多个属性,如名称,公告等,传入的数据键值对是 {@(NIMTeamUpdateTag) : NSString},无效数据将被过滤

◆ updateTeamIntro:teamId:completion:

- (void) updateTeamIntro: (NSString *)  intro
teamId: (NSString *)  teamId
completion: (nullable NIMTeamHandler completion 

更新群介绍

参数
intro群介绍
teamId群组ID
completion完成后的回调

◆ updateTeamInviteMode:teamId:completion:

- (void) updateTeamInviteMode: (NIMTeamInviteMode inviteMode
teamId: (NSString *)  teamId
completion: (nullable NIMTeamHandler completion 

更新群组邀请他人方式

参数
inviteMode邀请方式
teamId群组ID
completion完成后的回调

◆ updateTeamJoinMode:teamId:completion:

- (void) updateTeamJoinMode: (NIMTeamJoinMode joinMode
teamId: (NSString *)  teamId
completion: (nullable NIMTeamHandler completion 

更新群组验证方式

参数
joinMode验证方式
teamId群组ID
completion完成后的回调

◆ updateTeamName:teamId:completion:

- (void) updateTeamName: (NSString *)  teamName
teamId: (NSString *)  teamId
completion: (nullable NIMTeamHandler completion 

更新群组名称

参数
teamName群组名称
teamId群组ID
completion完成后的回调

◆ updateTeamUpdateClientCustomMode:teamId:completion:

- (void) updateTeamUpdateClientCustomMode: (NIMTeamUpdateClientCustomMode clientCustomMode
teamId: (NSString *)  teamId
completion: (nullable NIMTeamHandler completion 

更改群组更新自定义字段的权限

参数
clientCustomMode修改谁有权限更新群组自定义字段
teamId群组ID
completion完成后的回调

◆ updateTeamUpdateInfoMode:teamId:completion:

- (void) updateTeamUpdateInfoMode: (NIMTeamUpdateInfoMode updateInfoMode
teamId: (NSString *)  teamId
completion: (nullable NIMTeamHandler completion 

更改群组更新信息的权限

参数
updateInfoMode修改谁有权限更新群组信息
teamId群组ID
completion完成后的回调

◆ updateTInfosLocal:

- (BOOL) updateTInfosLocal: (NSArray< NIMTeam * > *)  teams

更新群本地信息

参数
teams需要更新的群对象 @discussion 这个用于修改本地群信息,不会同步到服务端

◆ updateUserNick:newNick:inTeam:completion:

- (void) updateUserNick: (NSString *)  userId
newNick: (NSString *)  newNick
inTeam: (NSString *)  teamId
completion: (nullable NIMTeamHandler completion 

更新成员群昵称

参数
userId群成员ID
newNick新的群成员昵称
teamId群组ID
completion完成后的回调

该协议的文档由以下文件生成: