NIMSDK-iOS
载入中...
搜索中...
未找到
NIMSuperTeamManagerProtocol.h
浏览该文件的文档.
1//
2// SuperTeamManagerProtocol.h
3// NIMLib
4//
5// Created by He on 2019/5/14.
6// Copyright © 2019 Netease. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "NIMTeamDefs.h"
11#import "NIMTeamMember.h"
13#import "NIMTeam.h"
16
17NS_ASSUME_NONNULL_BEGIN
18/**
19 * 超大群接口
20 */
21@protocol NIMSuperTeamManager <NSObject>
22
23/**
24 * 获取所有群组
25 *
26 * @return 返回所有群组
27 */
28- (nullable NSArray<NIMTeam *> *)allMyTeams;
29
30/**
31 * 根据群组 ID 获取具体的群组信息
32 *
33 * @param teamId 群组 ID
34 *
35 * @return 群组信息
36 * @discussion 如果自己不在群里,则该接口返回 nil
37 */
38- (nullable NIMTeam *)teamById:(NSString *)teamId;
39
40/**
41 * 根据群组ID判断是否是我所在的群
42 *
43 * @param teamId 群组ID
44 *
45 * @return 是否在此群组
46 */
47- (BOOL)isMyTeam:(NSString *)teamId;
48
49/**
50 * 退出群组
51 *
52 * @param teamId 群组ID
53 * @param completion 完成后的回调
54 */
55- (void)quitTeam:(NSString *)teamId
56 completion:(nullable NIMTeamHandler)completion;
57
58/**
59 * 邀请用户入群
60 *
61 * @param users 用户ID列表
62 * @param teamId 群组ID
63 * @param completion 完成后的回调
64 * @discussion 群主和管理员可以邀请用户
65 */
66- (void)addUsers:(NSArray<NSString *> *)users
67 toTeam:(NSString *)teamId
68 postscript:(nullable NSString *)postscript
69 attach:(nullable NSString *)attach
70 completion:(nullable NIMTeamMemberHandler)completion;
71
72/**
73 * 从群组内移除成员
74 *
75 * @param users 需要移除的用户ID列表
76 * @param teamId 群组ID
77 * @param completion 完成后的回调
78 * @discussion 群主和管理员可以移除成员,管理员不能踢群主,不能踢管理员。
79 */
80- (void)kickUsers:(NSArray<NSString *> *)users
81 fromTeam:(NSString *)teamId
82 completion:(nullable NIMTeamHandler)completion;
83
84/**
85 * 更新群组名称
86 *
87 * @param teamName 群组名称
88 * @param teamId 群组ID
89 * @param completion 完成后的回调
90 */
91- (void)updateTeamName:(NSString *)teamName
92 teamId:(NSString *)teamId
93 completion:(nullable NIMTeamHandler)completion;
94
95/**
96 * 更新群组头像
97 *
98 * @param teamAvatarUrl 群组头像Url
99 * @param teamId 群组ID
100 * @param completion 完成后的回调
101 */
102- (void)updateTeamAvatar:(NSString *)teamAvatarUrl
103 teamId:(NSString *)teamId
104 completion:(nullable NIMTeamHandler)completion;
105
106
107/**
108 * 更新群组验证方式
109 *
110 * @param joinMode 验证方式
111 * @param teamId 群组ID
112 * @param completion 完成后的回调
113 */
114- (void)updateTeamJoinMode:(NIMTeamJoinMode)joinMode
115 teamId:(NSString *)teamId
116 completion:(nullable NIMTeamHandler)completion;
117
118/**
119 * 更新群组被邀请人验证方式
120 *
121 * @param beInviteMode 邀请方式
122 * @param teamId 群组ID
123 * @param completion 完成后的回调
124 */
125- (void)updateTeamBeInviteMode:(NIMTeamBeInviteMode)beInviteMode
126 teamId:(NSString *)teamId
127 completion:(nullable NIMTeamHandler)completion;
128
129/**
130 * 更新群介绍
131 *
132 * @param intro 群介绍
133 * @param teamId 群组ID
134 * @param completion 完成后的回调
135 */
136- (void)updateTeamIntro:(NSString *)intro
137 teamId:(NSString *)teamId
138 completion:(nullable NIMTeamHandler)completion;
139
140
141/**
142 * 更新群公告
143 *
144 * @param announcement 群公告
145 * @param teamId 群组ID
146 * @param completion 完成后的回调
147 */
148- (void)updateTeamAnnouncement:(NSString *)announcement
149 teamId:(NSString *)teamId
150 completion:(nullable NIMTeamHandler)completion;
151
152/**
153 * 更新群自定义信息
154 *
155 * @param info 群自定义信息
156 * @param teamId 群组ID
157 * @param completion 完成后的回调
158 */
159- (void)updateTeamCustomInfo:(NSString *)info
160 teamId:(NSString *)teamId
161 completion:(nullable NIMTeamHandler)completion;
162
163/**
164 * 更新群信息
165 *
166 * @param values 需要更新的群信息键值对
167 * @param teamId 群组ID
168 * @param completion 完成后的回调
169 * @discussion 这个接口可以一次性修改群的多个属性,如名称,公告等,传入的数据键值对是 {@(NIMSuperTeamUpdateTag) : NSString},无效数据将被过滤.群主和管理员可修改
170 */
171- (void)updateTeamInfos:(NSDictionary<NSNumber *,NSString *> *)values
172 teamId:(NSString *)teamId
173 completion:(nullable NIMTeamHandler)completion;
174
175/**
176 * 群申请
177 *
178 * @param teamId 群组ID
179 * @param message 申请消息
180 * @param completion 完成后的回调
181 */
182- (void)applyToTeam:(NSString *)teamId
183 message:(NSString *)message
184 completion:(nullable NIMTeamApplyHandler)completion;
185
186
187/**
188 * 通过群申请
189 *
190 * @param teamId 群组ID
191 * @param userId 申请的用户ID
192 * @param completion 完成后的回调
193 */
194- (void)passApplyToTeam:(NSString *)teamId
195 userId:(NSString *)userId
196 completion:(nullable NIMTeamApplyHandler)completion;
197
198/**
199 * 拒绝群申请
200 *
201 * @param teamId 群组ID
202 * @param userId 申请的用户ID
203 * @param rejectReason 拒绝理由
204 * @param completion 完成后的回调
205 */
206- (void)rejectApplyToTeam:(NSString *)teamId
207 userId:(NSString *)userId
208 rejectReason:(NSString*)rejectReason
209 completion:(nullable NIMTeamHandler)completion;
210
211/**
212 * 更新成员群昵称
213 *
214 * @param userId 群成员ID
215 * @param newNick 新的群成员昵称
216 * @param teamId 群组ID
217 * @param completion 完成后的回调
218 */
219- (void)updateUserNick:(NSString *)userId
220 newNick:(NSString *)newNick
221 inTeam:(NSString *)teamId
222 completion:(nullable NIMTeamHandler)completion;
223
224/**
225 * 更新自己群自定义属性
226 *
227 * @param newInfo 新的自定义属性
228 * @param teamId 群组ID
229 * @param completion 完成后的回调
230 */
231- (void)updateMyCustomInfo:(NSString *)newInfo
232 inTeam:(NSString *)teamId
233 completion:(nullable NIMTeamHandler)completion;
234
235/**
236 * 添加管理员
237 *
238 * @param teamId 群组ID
239 * @param users 需要添加为管理员的用户ID列表
240 * @param completion 完成后的回调
241 */
242- (void)addManagersToTeam:(NSString *)teamId
243 users:(NSArray<NSString *> *)users
244 completion:(nullable NIMTeamHandler)completion;
245
246/**
247 * 移除管理员
248 *
249 * @param teamId 群组ID
250 * @param users 需要移除管理员的用户ID列表
251 * @param completion 完成后的回调
252 */
253- (void)removeManagersFromTeam:(NSString *)teamId
254 users:(NSArray<NSString *> *)users
255 completion:(nullable NIMTeamHandler)completion;
256
257/**
258 * 移交群主
259 *
260 * @param teamId 群组ID
261 * @param newOwnerId 新群主ID
262 * @param isLeave 是否同时离开群组
263 * @param completion 完成后的回调
264 */
265- (void)transferManagerWithTeam:(NSString *)teamId
266 newOwnerId:(NSString *)newOwnerId
267 isLeave:(BOOL)isLeave
268 completion:(nullable NIMTeamHandler)completion;
269
270/**
271 * 接受入群邀请
272 *
273 * @param teamId 群组ID
274 * @param invitorId 邀请者ID
275 * @param completion 完成后的回调
276 */
277- (void)acceptInviteWithTeam:(NSString*)teamId
278 invitorId:(NSString*)invitorId
279 completion:(nullable NIMTeamHandler)completion;
280
281
282/**
283 * 拒绝入群邀请
284 *
285 * @param teamId 群组ID
286 * @param invitorId 邀请者ID
287 * @param rejectReason 拒绝原因
288 * @param completion 完成后的回调
289 */
290- (void)rejectInviteWithTeam:(NSString*)teamId
291 invitorId:(NSString*)invitorId
292 rejectReason:(NSString*)rejectReason
293 completion:(nullable NIMTeamHandler)completion;
294
295/**
296 * 修改群通知状态
297 *
298 * @param state 群通知状态
299 * @param teamId 群组ID
300 * @param completion 完成后的回调
301 */
302- (void)updateNotifyState:(NIMTeamNotifyState)state
303 inTeam:(NSString *)teamId
304 completion:(nullable NIMTeamHandler)completion;
305
306/**
307 * 群通知状态
308 *
309 * @param teamId 群Id
310 *
311 * @return 群通知状态
312 */
313- (NIMTeamNotifyState)notifyStateForNewMsg:(NSString *)teamId;
314
315
316/**
317 * 群成员禁言
318 *
319 * @param mute 是否禁言
320 * @param userIds 用户ID
321 * @param teamId 群组ID
322 * @param completion 经验操作完成后的回调
323 * @discussion 操作成功后,云信服务器会下发禁言的群通知消息
324 */
325- (void)updateMuteState:(BOOL)mute
326 userIds:(NSArray<NSString *> *)userIds
327 inTeam:(NSString *)teamId
328 completion:(nullable NIMTeamHandler)completion;
329
330/**
331 * 禁言群全体成员
332 *
333 * @param mute 是否禁言
334 * @param teamId 群组ID
335 * @param completion 经验操作完成后的回调
336 * @discussion 操作成功后,云信服务器会下发禁言的群通知消息
337 */
338- (void)updateMuteState:(BOOL)mute
339 inTeam:(NSString *)teamId
340 completion:(nullable NIMTeamHandler)completion;
341
342/**
343 * 获取超大群组成员
344 *
345 * @param teamId 群组ID
346 * @param completion 完成后的回调
347 * @discussion 绝大多数情况这个请求都是从本地读取缓存并同步返回,但是由于群成员信息量较大, SDK 采取的是登录后延迟拉取的策略
348 * 考虑到用户网络等问题, SDK 有可能没有及时缓存群成员信息,那么这个请求将是个带网络请求的异步操作(增量请求)。
349 * 同时这个接口会去请求本地没有缓存的群用户的资料信息,但不会触发 - (void)onUserInfoChanged: 回调。
350 */
351- (void)fetchTeamMembers:(NSString *)teamId
352 option:(NIMTeamFetchMemberOption *)option
353 completion:(nullable NIMTeamMemberHandler)completion;
354
355/**
356 * 获取群内被禁言的成员列表
357 *
358 * @param teamId 群组ID
359 * @param completion 完成后的回调
360 * @discussion 绝大多数情况这个请求都是从本地读取缓存并同步返回,但是由于群成员信息量较大, SDK 采取的是登录后延迟拉取的策略
361 * 考虑到用户网络等问题, SDK 有可能没有及时缓存群成员信息,那么这个请求将是个带网络请求的异步操作(增量请求)。
362 * 同时这个接口会去请求本地没有缓存的群用户的资料信息,但不会触发 - (void)onUserInfoChanged: 回调。
363 */
364- (void)fetchTeamMutedMembers:(NSString *)teamId
365 completion:(nullable NIMTeamMemberHandler)completion;
366
367
368/**
369 * 群成员类型查询成员列表
370 *
371 * @param teamId 群组ID
372 * @param option 搜索配置
373 * @param completion 完成后的回调
374 *
375 */
376- (void)getTeamMemberList:(NSString *)teamId
377 option:(NIMTeamMemberRoleTypeSearchOption *)option
378 completion:(nullable NIMTeamMemberSearchResultHandler)completion;
379
380
381/**
382 * 获取群信息
383 *
384 * @param teamId 群组ID
385 * @param completion 完成后的回调
386 */
387- (void)fetchTeamInfo:(NSString *)teamId
388 completion:(nullable NIMTeamFetchInfoHandler)completion;
389
390
391/**
392 * 获取单个群成员信息
393 *
394 * @param userId 用户ID
395 * @param teamId 群组ID
396 * @return 返回成员信息
397 * @discussion 返回本地缓存的群成员信息,如果本地没有相应数据则返回 nil。
398 */
399- (nullable NIMTeamMember *)teamMember:(NSString *)userId
400 inTeam:(NSString *)teamId;
401
402/**
403 * 群成员添加特别关注
404 *
405 * @param teamId 群组ID
406 * @param accoutIds 群成员id
407 * @param completion 完成后的回调
408 */
409- (void)addTeamMembersFollow:(NSString *)teamId
410 accoutIds:(NSArray <NSString*>*)accoutIds
411 completion:(nullable NIMTeamHandler)completion;
412
413
414/**
415 * 群成员移除特别关注
416 *
417 * @param teamId 群组ID
418 * @param accoutIds 群成员id
419 * @param completion 完成后的回调
420 */
421- (void)removeTeamMembersFollow:(NSString *)teamId
422 accoutIds:(NSArray <NSString*>*)accoutIds
423 completion:(nullable NIMTeamHandler)completion;
424
425/**
426 * 添加超大群组委托
427 *
428 * @param delegate 群组委托
429 */
430- (void)addDelegate:(id<NIMTeamManagerDelegate>)delegate;
431
432/**
433 * 移除超大群组委托
434 *
435 * @param delegate 群组委托
436 */
437- (void)removeDelegate:(id<NIMTeamManagerDelegate>)delegate;
438@end
439
440
441NS_ASSUME_NONNULL_END
NIMTeamBeInviteMode
Definition: NIMTeamDefs.h:72
void(^ NIMTeamHandler)(NSError *__nullable error)
Definition: NIMTeamDefs.h:199
NIMTeamNotifyState
Definition: NIMTeamDefs.h:160
void(^ NIMTeamFetchInfoHandler)(NSError *__nullable error, NIMTeam *__nullable team)
Definition: NIMTeamDefs.h:241
NIMTeamJoinMode
Definition: NIMTeamDefs.h:37
void(^ NIMTeamMemberSearchResultHandler)(NSError *__nullable error, NIMTeamMemberSearchResult *__nullable result)
Definition: NIMTeamDefs.h:233
void(^ NIMTeamApplyHandler)(NSError *__nullable error, NIMTeamApplyStatus applyStatus)
Definition: NIMTeamDefs.h:249
void(^ NIMTeamMemberHandler)(NSError *__nullable error, NSArray< NIMTeamMember * > *__nullable members)
Definition: NIMTeamDefs.h:224
Definition: NIMTeamFetchMemberOption.h:14
Definition: NIMTeam.h:19
Definition: NIMTeamMember.h:17
Definition: NIMTeamMemberSearchOption.h:30