IEMChatroomManager.h 77 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171
  1. /**
  2. * \~chinese
  3. * @header IEMChatroomManager.h
  4. * @abstract 聊天室相关操作协议类。
  5. * @author Hyphenate
  6. * @version 3.00
  7. *
  8. * \~english
  9. * @header IEMChatroomManager.h
  10. * @abstract This protocol defines the chat room operations.
  11. * @author Hyphenate
  12. * @version 3.00
  13. */
  14. #import <Foundation/Foundation.h>
  15. #import "EMCommonDefs.h"
  16. #import "EMChatroomManagerDelegate.h"
  17. #import "EMChatroomOptions.h"
  18. #import "EMChatroom.h"
  19. #import "EMPageResult.h"
  20. #import "EMCursorResult.h"
  21. @class EMError;
  22. /**
  23. * \~chinese
  24. * 管理聊天室的类。
  25. *
  26. * \~english
  27. * A class that manages the chatrooms.
  28. */
  29. @protocol IEMChatroomManager <NSObject>
  30. @required
  31. #pragma mark - Delegate
  32. /**
  33. * \~chinese
  34. * 添加回调代理。
  35. *
  36. * @param aDelegate 要添加的代理。
  37. * @param aQueue 代理执行的队列。
  38. *
  39. * \~english
  40. * Adds the SDK delegate.
  41. *
  42. * @param aDelegate The delegate that you want to add: ChatroomManagerDelegate.
  43. * @param aQueue (Optional) The queue of calling the delegate methods. To run the app on the main thread, set this parameter as nil.
  44. */
  45. - (void)addDelegate:(id<EMChatroomManagerDelegate> _Nonnull)aDelegate
  46. delegateQueue:(dispatch_queue_t _Nullable)aQueue;
  47. /**
  48. * \~chinese
  49. * 移除回调代理。
  50. *
  51. * @param aDelegate 要移除的代理。
  52. *
  53. * \~english
  54. * Removes the delegate.
  55. *
  56. * @param aDelegate The delegate that you want to remove.
  57. */
  58. - (void)removeDelegate:(id<EMChatroomManagerDelegate> _Nonnull)aDelegate;
  59. #pragma mark - Fetch Chatrooms
  60. /**
  61. * \~chinese
  62. * 从服务器获取指定数目的聊天室。
  63. *
  64. * 同步方法,会阻塞当前线程。
  65. *
  66. * @param aPageNum 获取第几页。
  67. * @param aPageSize 获取多少条。
  68. * @param pError 出错信息。
  69. *
  70. * @result 获取的聊天室列表,详见 EMPageResult。
  71. *
  72. * \~english
  73. * Gets the specified number of chat rooms from the server.
  74. *
  75. * This is a synchronous method and blocks the current thread.
  76. *
  77. * @param aPageNum The page number.
  78. * @param aPageSize The page size.
  79. * @param pError The error information if the method fails: Error.
  80. *
  81. * @result The chat room list. See EMPageResult.
  82. */
  83. - (EMPageResult<EMChatroom*> *_Nullable)getChatroomsFromServerWithPage:(NSInteger)aPageNum
  84. pageSize:(NSInteger)aPageSize
  85. error:(EMError **_Nullable)pError;
  86. /**
  87. * \~chinese
  88. * 从服务器获取指定数目的聊天室。
  89. *
  90. * 异步方法。
  91. *
  92. * @param aPageNum 获取第几页。
  93. * @param aPageSize 获取多少条。
  94. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  95. *
  96. * \~english
  97. * Gets the specified number of chat rooms from the server.
  98. *
  99. * This is an asynchronous method.
  100. *
  101. * @param aPageNum The page number.
  102. * @param aPageSize The page size.
  103. * @param aCompletionBlock The completion block, which contains the error message if the method call fails.
  104. *
  105. */
  106. - (void)getChatroomsFromServerWithPage:(NSInteger)aPageNum
  107. pageSize:(NSInteger)aPageSize
  108. completion:(void (^_Nullable)(EMPageResult<EMChatroom*> *_Nullable aResult, EMError *_Nullable aError))aCompletionBlock;
  109. #pragma mark - Create
  110. /**
  111. * \~chinese
  112. * 创建聊天室。
  113. *
  114. * 同步方法,会阻塞当前线程。
  115. *
  116. * @param aSubject 聊天室主题。
  117. * @param aDescription 聊天室描述。
  118. * @param aInvitees 聊天室的成员,不包括聊天室创建者自己。
  119. * @param aMessage 加入聊天室的邀请内容。
  120. * @param aMaxMembersCount 聊天室最大成员数。
  121. * @param pError 出错信息。
  122. *
  123. * @result 创建的聊天室,详见 EMChatroom。
  124. *
  125. * \~english
  126. * Creates a chatroom.
  127. *
  128. * This is a synchronous method and blocks the current thread.
  129. *
  130. * @param aSubject The subject of the chatroom.
  131. * @param aDescription The description of the chatroom.
  132. * @param aInvitees The members of the chatroom. Do not include the creator.
  133. * @param aMessage The invitation message.
  134. * @param aMaxMembersCount The maximum number of members in the chatroom.
  135. * @param pError The error information if the method fails: Error.
  136. *
  137. * @result The create chatroom. See EMChatroom.
  138. */
  139. - (EMChatroom *_Nullable)createChatroomWithSubject:(NSString *_Nullable)aSubject
  140. description:(NSString *_Nullable)aDescription
  141. invitees:(NSArray<NSString *> *_Nullable)aInvitees
  142. message:(NSString *_Nullable)aMessage
  143. maxMembersCount:(NSInteger)aMaxMembersCount
  144. error:(EMError **_Nullable)pError;
  145. /**
  146. * \~chinese
  147. * 创建一个聊天室。
  148. *
  149. * 异步方法。
  150. *
  151. * @param aSubject 聊天室主题。
  152. * @param aDescription 聊天室描述。
  153. * @param aInvitees 聊天室的成员,不包括聊天室创建者自己。
  154. * @param aMessage 加入聊天室的邀请内容。
  155. * @param aMaxMembersCount 聊天室最大成员数。
  156. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  157. *
  158. *
  159. * \~english
  160. * Creates a chatroom.
  161. *
  162. * This is an asynchronous method.
  163. *
  164. * @param aSubject The subject of the chatroom.
  165. * @param aDescription The description of the chatroom.
  166. * @param aInvitees The members of the chatroom. Do not include the creator.
  167. * @param aMessage The invitation message.
  168. * @param aMaxMembersCount The maximum number of members in the chatroom.
  169. * @param aCompletionBlock The completion block, which contains the error message if the method call fails.
  170. *
  171. */
  172. - (void)createChatroomWithSubject:(NSString *_Nullable)aSubject
  173. description:(NSString *_Nullable)aDescription
  174. invitees:(NSArray<NSString *> *_Nullable)aInvitees
  175. message:(NSString *_Nullable)aMessage
  176. maxMembersCount:(NSInteger)aMaxMembersCount
  177. completion:(void (^_Nullable)(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
  178. #pragma mark - Edit Chatroom
  179. /**
  180. * \~chinese
  181. * 加入一个聊天室。
  182. *
  183. * 同步方法,会阻塞当前线程。
  184. *
  185. * @param aChatroomId 聊天室的 ID。
  186. * @param pError 返回的错误信息。
  187. *
  188. * @result 所加入的聊天室,详见 EMChatroom。
  189. *
  190. * \~english
  191. * Joins a chatroom.
  192. *
  193. * This is a synchronous method and blocks the current thread.
  194. *
  195. * @param aChatroomId The chatroom ID.
  196. * @param pError The error information if the method fails: Error.
  197. *
  198. * @result The chatroom instance.
  199. */
  200. - (EMChatroom *)joinChatroom:(NSString * _Nonnull)aChatroomId
  201. error:(EMError ** _Nullable)pError;
  202. /**
  203. * \~chinese
  204. * 加入聊天室。
  205. *
  206. * 异步方法。
  207. *
  208. * @param aChatroomId 聊天室的 ID。
  209. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  210. *
  211. *
  212. * \~english
  213. * Joins a chatroom.
  214. *
  215. * This is an asynchronous method.
  216. *
  217. * @param aChatroomId The chatroom ID.
  218. * @param aCompletionBlock The completion block, which contains the error message if the method call fails.
  219. *
  220. */
  221. - (void)joinChatroom:(NSString *_Nonnull)aChatroomId
  222. completion:(void (^_Nullable)(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
  223. /**
  224. * \~chinese
  225. * 退出聊天室。
  226. *
  227. * 同步方法,会阻塞当前线程。
  228. *
  229. * @param aChatroomId 聊天室 ID。
  230. * @param pError 错误信息。
  231. *
  232. *
  233. * \~english
  234. * Leaves a chatroom.
  235. *
  236. * This is a synchronous method and blocks the current thread.
  237. *
  238. * @param aChatroomId The chatroom ID.
  239. * @param pError The error information if the method fails: Error.
  240. *
  241. */
  242. - (void)leaveChatroom:(NSString *_Nonnull)aChatroomId
  243. error:(EMError **_Nullable)pError;
  244. /**
  245. * \~chinese
  246. * 退出聊天室。
  247. *
  248. * 异步方法。
  249. *
  250. * @param aChatroomId 聊天室 ID。
  251. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  252. *
  253. *
  254. * \~english
  255. * Leaves a chatroom.
  256. *
  257. * This is an asynchronous method.
  258. *
  259. * @param aChatroomId The chatroom ID.
  260. * @param aCompletionBlock The completion block, which contains the error message if the method call fails.
  261. *
  262. */
  263. - (void)leaveChatroom:(NSString *_Nonnull)aChatroomId
  264. completion:(void (^_Nullable)(EMError *_Nullable aError))aCompletionBlock;
  265. /**
  266. * \~chinese
  267. * 解散聊天室。
  268. *
  269. * 仅聊天室所有者可以解散聊天室。
  270. *
  271. * 同步方法,会阻塞当前线程。
  272. *
  273. * @param aChatroomId 聊天室 ID。
  274. *
  275. * @result - 如果方法调用成功,返回 nil。
  276. * - 如果方法调用失败,返回错误信息。详见 EMError。
  277. *
  278. * \~english
  279. * Dismisses a chatroom.
  280. *
  281. * Only the owner of a chatroom has the privilege to dismiss it.
  282. *
  283. * This is a synchronous method and blocks the current thread.
  284. *
  285. * @param aChatroomId The chatroom ID.
  286. *
  287. * @result - `nil` if the method call succeeds.
  288. * - Error information if the method call fails. See EMError.
  289. */
  290. - (EMError *_Nullable)destroyChatroom:(NSString *_Nonnull)aChatroomId;
  291. /**
  292. * \~chinese
  293. * 解散聊天室。
  294. *
  295. * 仅聊天室所有者可以解散聊天室。
  296. *
  297. * 异步方法。
  298. *
  299. * @param aChatroomId 聊天室 ID。
  300. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  301. *
  302. * \~english
  303. * Dismisses a chatroom.
  304. *
  305. * Only the owner of a chatroom has the privilege to dismiss it.
  306. *
  307. * This is an asynchronous method.
  308. *
  309. * @param aChatroomId The chatroom ID.
  310. * @param aCompletionBlock The completion block, which contains the error message if the method call fails.
  311. *
  312. */
  313. - (void)destroyChatroom:(NSString *_Nonnull)aChatroomId
  314. completion:(void (^_Nullable)(EMError * _Nullable aError))aCompletionBlock;
  315. #pragma mark - Fetch
  316. /**
  317. * \~chinese
  318. * 获取指定的聊天室。
  319. *
  320. * 同步方法,会阻塞当前线程。
  321. *
  322. * @param aChatroomId 聊天室 ID。
  323. * @param pError 错误信息。
  324. *
  325. * @result 聊天室实例,详见 EMChatroom。
  326. *
  327. * \~english
  328. * Fetches the specific chatroom.
  329. *
  330. * This is a synchronous method and blocks the current thread.
  331. *
  332. * @param aChatroomId The chatroom ID.
  333. * @param pError The error information if the method fails: Error.
  334. *
  335. * @result The chatroom instance. See EMChatroom.
  336. */
  337. - (EMChatroom *_Nullable)getChatroomSpecificationFromServerWithId:(NSString *_Nonnull)aChatroomId
  338. error:(EMError *_Nullable*)pError;
  339. /**
  340. * \~chinese
  341. * 获取聊天室详情。
  342. *
  343. * 异步方法。
  344. *
  345. * @param aChatroomId 聊天室 ID
  346. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  347. *
  348. * \~english
  349. * Fetches the chat room specifications.
  350. *
  351. * This is an asynchronous method.
  352. *
  353. * @param aChatroomId The chatroom ID.
  354. * @param aCompletionBlock The completion block, which contains the error message if the method call fails.
  355. *
  356. */
  357. - (void)getChatroomSpecificationFromServerWithId:(NSString *_Nonnull)aChatroomId
  358. completion:(void (^_Nullable)(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
  359. /**
  360. * \~chinese
  361. * 获取聊天室详情。
  362. *
  363. * 异步方法。
  364. *
  365. * @param aChatroomId 聊天室 ID
  366. * @param aFetchMembers 是否获取聊天室成员,为 YES 时,一次性返回 200 个以内成员。
  367. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  368. *
  369. * \~english
  370. * Fetches the chat room specifications.
  371. *
  372. * This is an asynchronous method.
  373. *
  374. * @param aChatroomId The chatroom ID.
  375. * @param aFetchMembers Whether to get the member list. If you set the parameter as YES, it will return no more than 200 members.
  376. * @param aCompletionBlock The completion block, which contains the error message if the method call fails.
  377. *
  378. */
  379. - (void)getChatroomSpecificationFromServerWithId:(NSString *_Nonnull)aChatroomId
  380. fetchMembers:(bool)aFetchMembers
  381. completion:(void (^_Nullable)(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
  382. /**
  383. * \~chinese
  384. * 获取聊天室成员列表。
  385. *
  386. * 同步方法,会阻塞当前线程。
  387. *
  388. * @param aChatroomId 聊天室 ID。
  389. * @param aCursor 游标,首次调用传空。
  390. * @param aPageSize 获取多少条。
  391. * @param pError 错误信息。
  392. *
  393. * @result 聊天室成员列表和游标。
  394. *
  395. * \~english
  396. * Gets the list of chatroom members from the server.
  397. *
  398. * This is a synchronous method and blocks the current thread.
  399. *
  400. * @param aChatroomId The chatroom ID.
  401. * @param aCursor The cursor. Set this parameter as nil when you call this method for the first time.
  402. * @param aPageSize The page size.
  403. * @param pError The error information if the method fails: Error.
  404. *
  405. * @result The list of chatroom members and the cursor.
  406. *
  407. */
  408. - (EMCursorResult<NSString*> *_Nullable)getChatroomMemberListFromServerWithId:(NSString *_Nonnull)aChatroomId
  409. cursor:(NSString *_Nullable)aCursor
  410. pageSize:(NSInteger)aPageSize
  411. error:(EMError **_Nullable)pError;
  412. /**
  413. * \~chinese
  414. * 获取聊天室成员列表。
  415. *
  416. * 异步方法。
  417. *
  418. * @param aChatroomId 聊天室 ID。
  419. * @param aCursor 游标,首次调用传空。
  420. * @param aPageSize 获取多少条。
  421. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  422. *
  423. *
  424. * \~english
  425. * Gets the list of chatroom members from the server.
  426. *
  427. * This is an asynchronous method.
  428. *
  429. * @param aChatroomId The chatroom ID.
  430. * @param aCursor The cursor. Set this parameter as nil when you call this method for the first time.
  431. * @param aPageSize The page size.
  432. * @param aCompletionBlock The completion block, which contains the error message if the method call fails.
  433. *
  434. */
  435. - (void)getChatroomMemberListFromServerWithId:(NSString *_Nonnull)aChatroomId
  436. cursor:(NSString *_Nullable)aCursor
  437. pageSize:(NSInteger)aPageSize
  438. completion:(void (^_Nullable)(EMCursorResult<NSString*> *_Nullable aResult, EMError *_Nullable aError))aCompletionBlock;
  439. /**
  440. * \~chinese
  441. * 获取聊天室黑名单列表。
  442. *
  443. * 仅聊天室所有者或者管理员可以获取黑名单。
  444. *
  445. * 同步方法,会阻塞当前线程。
  446. *
  447. * @param aChatroomId 聊天室 ID。
  448. * @param aPageNum 获取第几页。
  449. * @param aPageSize 获取多少条。
  450. * @param pError 错误信息。
  451. *
  452. *
  453. * \~english
  454. * Gets the blocklist of chatroom from the server.
  455. *
  456. * Only the chatroom owner or admin can call this method.
  457. *
  458. * This is a synchronous method and blocks the current thread.
  459. *
  460. * @param aChatroomId The chatroom ID.
  461. * @param aPageNum The page number.
  462. * @param aPageSize The page size.
  463. * @param pError The error information if the method fails: Error.
  464. *
  465. */
  466. - (NSArray<NSString *> *_Nullable)getChatroomBlacklistFromServerWithId:(NSString *_Nonnull)aChatroomId
  467. pageNumber:(NSInteger)aPageNum
  468. pageSize:(NSInteger)aPageSize
  469. error:(EMError **_Nullable)pError;
  470. /**
  471. * \~chinese
  472. * 获取聊天室黑名单列表。
  473. *
  474. * 仅聊天室所有者或者管理员可以获取黑名单。
  475. *
  476. * 异步方法。
  477. *
  478. * @param aChatroomId 聊天室 ID。
  479. * @param aPageNum 获取第几页。
  480. * @param aPageSize 获取多少条。
  481. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  482. *
  483. *
  484. * \~english
  485. * Gets the chatroom's blocklist.
  486. *
  487. * Only the chatroom owner or admin can call this method.
  488. *
  489. * This is an asynchronous method.
  490. *
  491. * @param aChatroomId The chatroom ID.
  492. * @param aPageNum The page number.
  493. * @param aPageSize The page size.
  494. * @param aCompletionBlock The completion block, which contains the error message if the method call fails.
  495. *
  496. */
  497. - (void)getChatroomBlacklistFromServerWithId:(NSString *_Nonnull)aChatroomId
  498. pageNumber:(NSInteger)aPageNum
  499. pageSize:(NSInteger)aPageSize
  500. completion:(void (^_Nullable)(NSArray<NSString *> *_Nullable aList, EMError *_Nullable aError))aCompletionBlock;
  501. /**
  502. * \~chinese
  503. * 获取聊天室被禁言列表。
  504. *
  505. * 仅聊天室所有者和管理员可调用此方法。
  506. *
  507. * 同步方法,会阻塞当前线程。
  508. *
  509. * @param aChatroomId 聊天室 ID。
  510. * @param aPageNum 获取第几页。
  511. * @param aPageSize 获取多少条。
  512. * @param pError 错误信息。
  513. *
  514. *
  515. * \~english
  516. * Gets the list of members who are muted in the chatroom from the server.
  517. *
  518. * Only the chatroom owner or admin can call this method.
  519. *
  520. * This is a synchronous method and blocks the current thread.
  521. *
  522. * @param aChatroomId The chatroom ID.
  523. * @param aPageNum The page number.
  524. * @param aPageSize The page size.
  525. * @param pError The error information if the method fails: Error.
  526. *
  527. */
  528. - (NSArray<NSString *> *_Nullable)getChatroomMuteListFromServerWithId:(NSString *_Nonnull)aChatroomId
  529. pageNumber:(NSInteger)aPageNum
  530. pageSize:(NSInteger)aPageSize
  531. error:(EMError **_Nullable)pError;
  532. /**
  533. * \~chinese
  534. * 获取聊天室被禁言列表。
  535. *
  536. * 仅聊天室所有者和管理员可调用此方法。
  537. *
  538. * 异步方法。
  539. *
  540. * @param aChatroomId 聊天室 ID。
  541. * @param aPageNum 获取第几页。
  542. * @param aPageSize 获取多少条。
  543. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  544. *
  545. *
  546. * \~english
  547. * Gets the list of members who were muted in the chatroom from the server.
  548. *
  549. * Only the chatroom owner or admin can call this method.
  550. *
  551. * This is an asynchronous method.
  552. *
  553. * @param aChatroomId The chatroom ID.
  554. * @param aPageNum The page number.
  555. * @param aPageSize The page size.
  556. * @param aCompletionBlock The completion block, which contains the error message if the method call fails.
  557. *
  558. */
  559. - (void)getChatroomMuteListFromServerWithId:(NSString *_Nonnull)aChatroomId
  560. pageNumber:(NSInteger)aPageNum
  561. pageSize:(NSInteger)aPageSize
  562. completion:(void (^_Nullable)(NSArray<NSString *> *_Nullable aList, EMError *_Nullable aError))aCompletionBlock;
  563. /**
  564. * \~chinese
  565. * 获取聊天室白名单列表。
  566. *
  567. * 仅聊天室所有者和管理员可调用此方法。
  568. *
  569. * 同步方法,会阻塞当前线程。
  570. *
  571. * @param aChatroomId 聊天室 ID。
  572. * @param pError 错误信息。
  573. *
  574. *
  575. * \~english
  576. * Gets the allowlist of a chatroom from the server.
  577. *
  578. * Only the chatroom owner or admin can call this method.
  579. *
  580. * This is a synchronous method and blocks the current thread.
  581. *
  582. * @param aChatroomId The chatroom ID.
  583. * @param pError The error information if the method fails: Error.
  584. *
  585. */
  586. - (NSArray<NSString *> *_Nullable)getChatroomWhiteListFromServerWithId:(NSString *_Nonnull)aChatroomId
  587. error:(EMError **_Nullable)pError;
  588. /**
  589. * \~chinese
  590. * 获取聊天室白名单列表。
  591. *
  592. * 仅聊天室所有者和管理员可调用此方法。
  593. *
  594. * 异步方法。
  595. *
  596. * @param aChatroomId 聊天室 ID。
  597. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  598. *
  599. *
  600. * \~english
  601. * Gets the allowlist of a chatroom from the server.
  602. *
  603. * Only the chatroom owner or admin can call this method.
  604. *
  605. * This is an asynchronous method.
  606. *
  607. * @param aChatroomId The chatroom ID.
  608. * @param aCompletionBlock The completion block, which contains the error message if the method call fails.
  609. *
  610. */
  611. - (void)getChatroomWhiteListFromServerWithId:(NSString *_Nonnull)aChatroomId
  612. completion:(void (^_Nullable)(NSArray<NSString *> *_Nullable aList, EMError *_Nullable aError))aCompletionBlock;
  613. /**
  614. * \~chinese
  615. * 查看当前用户是否在聊天室白名单中。
  616. *
  617. * 同步方法,会阻塞当前线程。
  618. *
  619. * @param aChatroomId 聊天室 ID。
  620. * @param pError 错误信息。
  621. *
  622. *
  623. * \~english
  624. * Checks whether the current user is on the allowlist.
  625. *
  626. * This is a synchronous method and blocks the current thread.
  627. *
  628. * @param aChatroomId The chatroom ID.
  629. * @param pError The error information if the method fails: Error.
  630. *
  631. */
  632. - (BOOL)isMemberInWhiteListFromServerWithChatroomId:(NSString *_Nonnull)aChatroomId
  633. error:(EMError **_Nullable )pError;
  634. /**
  635. * \~chinese
  636. * 查看当前用户是否在聊天室白名单中。
  637. *
  638. * 异步方法。
  639. *
  640. * @param aChatroomId 聊天室 ID。
  641. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  642. *
  643. *
  644. * \~english
  645. * Checks whether the current user is on the allowlist.
  646. *
  647. * This is an asynchronous method.
  648. *
  649. * @param aChatroomId The chatroom ID.
  650. * @param aCompletionBlock The completion block, which contains the error message if the method call fails.
  651. *
  652. */
  653. - (void)isMemberInWhiteListFromServerWithChatroomId:(NSString *_Nonnull)aChatroomId
  654. completion:(void (^_Nullable)(BOOL inWhiteList, EMError *_Nullable aError))aCompletionBlock;
  655. /**
  656. * \~chinese
  657. * 查看当前用户是否在聊天室禁言名单中。
  658. *
  659. * 异步方法。
  660. *
  661. * @param aChatroomId 聊天室 ID。
  662. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  663. *
  664. *
  665. * \~english
  666. * Checks whether the current user is on the mute list.
  667. *
  668. * This is an asynchronous method.
  669. *
  670. * @param aChatroomId The chatroom ID.
  671. * @param aCompletionBlock The completion block, which contains the error message if the method call fails.
  672. *
  673. */
  674. - (void)isMemberInMuteListFromServerWithChatroomId:(NSString *_Nonnull)aChatroomId
  675. completion:(void (^_Nullable)(BOOL inMuteList, EMError *_Nullable aError))aCompletionBlock;
  676. /**
  677. * \~chinese
  678. * 获取聊天室公告。
  679. *
  680. * 同步方法,会阻塞当前线程。
  681. *
  682. * @param aChatroomId 聊天室 ID。
  683. * @param pError 错误信息。
  684. *
  685. * @result 聊天室公告。
  686. *
  687. * \~english
  688. * Gets the announcement of a chatroom from the server.
  689. *
  690. * This is a synchronous method and blocks the current thread.
  691. *
  692. * @param aChatroomId The chatroom ID.
  693. * @param pError The error information if the method fails: Error.
  694. *
  695. * @result The announcement of chatroom.
  696. */
  697. - (NSString *_Nullable)getChatroomAnnouncementWithId:(NSString *_Nonnull)aChatroomId
  698. error:(EMError **_Nullable )pError;
  699. /**
  700. * \~chinese
  701. * 获取聊天室公告。
  702. *
  703. * 异步方法。
  704. *
  705. * @param aChatroomId 聊天室 ID。
  706. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  707. *
  708. * \~english
  709. * Gets the announcement of a chatroom from the server.
  710. *
  711. * This is an asynchronous method.
  712. *
  713. * @param aChatroomId The chatroom ID.
  714. * @param aCompletionBlock The completion block, which contains the error message if the method call fails.
  715. *
  716. */
  717. - (void)getChatroomAnnouncementWithId:(NSString *_Nonnull)aChatroomId
  718. completion:(void (^_Nullable)(NSString *_Nullable aAnnouncement, EMError *_Nullable aError))aCompletionBlock;
  719. #pragma mark - Edit
  720. /**
  721. * \~chinese
  722. * 更改聊天室主题。
  723. *
  724. * 仅聊天室所有者有权限调用此方法。
  725. *
  726. * 同步方法,会阻塞当前线程。
  727. *
  728. * @param aSubject 新聊天室主题。
  729. * @param aChatroomId 聊天室 ID。
  730. * @param pError 错误信息。
  731. *
  732. * @result 聊天室实例。
  733. *
  734. * \~english
  735. * Changes the chatroom‘s subject.
  736. *
  737. * Only the chatroom owner can call this method.
  738. *
  739. * This is a synchronous method and blocks the current thread.
  740. *
  741. * @param aSubject The new subject of the chatroom.
  742. * @param aChatroomId The chatroom ID.
  743. * @param pError The error information if the method fails: Error.
  744. *
  745. * @result The chatroom instance.
  746. */
  747. - (EMChatroom *)updateSubject:(NSString *_Nullable )aSubject
  748. forChatroom:(NSString *_Nonnull)aChatroomId
  749. error:(EMError **_Nullable )pError;
  750. /**
  751. * \~chinese
  752. * 更改聊天室主题。
  753. *
  754. * 仅聊天室所有者有权限调用此方法。
  755. *
  756. * 异步方法。
  757. *
  758. * @param aSubject 聊天室新主题。
  759. * @param aChatroomId 聊天室 ID。
  760. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  761. *
  762. *
  763. * \~english
  764. * Changes the chatroom subject.
  765. *
  766. * Only the chatroom owner can call this method.
  767. *
  768. * This is an asynchronous method.
  769. *
  770. * @param aSubject The new subject of the chatroom.
  771. * @param aChatroomId The chatroom ID.
  772. * @param aCompletionBlock The completion block, which contains the error message if the method call fails.
  773. *
  774. */
  775. - (void)updateSubject:(NSString *_Nullable )aSubject
  776. forChatroom:(NSString *_Nonnull)aChatroomId
  777. completion:(void (^_Nullable )(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
  778. /**
  779. * \~chinese
  780. * 更改聊天室说明信息。
  781. *
  782. * 仅聊天室所有者有权限调用此方法。
  783. *
  784. * 同步方法,会阻塞当前线程。
  785. *
  786. * @param aDescription 说明信息。
  787. * @param aChatroomId 聊天室 ID。
  788. * @param pError 错误信息。
  789. *
  790. * @result 聊天室实例。
  791. *
  792. * \~english
  793. * Changes chatroom description.
  794. *
  795. * Only the chatroom owner can call this method.
  796. *
  797. * This is a synchronous method and blocks the current thread.
  798. *
  799. * @param aDescription The new description.
  800. * @param aChatroomId The chatroom ID.
  801. * @param pError The error information if the method fails: Error.
  802. *
  803. * @result The chatroom instance.
  804. */
  805. - (EMChatroom *_Nullable )updateDescription:(NSString *_Nullable )aDescription
  806. forChatroom:(NSString *_Nonnull)aChatroomId
  807. error:(EMError **_Nullable )pError;
  808. /**
  809. * \~chinese
  810. * 更改聊天室说明信息。
  811. *
  812. * 仅聊天室所有者有权限调用此方法。
  813. *
  814. * 异步方法。
  815. *
  816. * @param aDescription 说明信息。
  817. * @param aChatroomId 聊天室 ID。
  818. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  819. *
  820. *
  821. * \~english
  822. * Changes the chatroom's description.
  823. *
  824. * Only the chatroom owner can call this method.
  825. *
  826. * This is an asynchronous method.
  827. *
  828. * @param aDescription The new description.
  829. * @param aChatroomId The chatroom ID.
  830. * @param aCompletionBlock The completion block, which contains the error message if the method call fails.
  831. *
  832. */
  833. - (void)updateDescription:(NSString *_Nullable )aDescription
  834. forChatroom:(NSString *_Nonnull)aChatroomId
  835. completion:(void (^_Nullable )(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
  836. /**
  837. * \~chinese
  838. * 将成员移出聊天室。
  839. *
  840. * 仅聊天室所有者和管理员可调用此方法。
  841. *
  842. * 同步方法,会阻塞当前线程。
  843. *
  844. * @param aMembers 要移出的用户列表。
  845. * @param aChatroomId 聊天室 ID。
  846. * @param pError 错误信息。
  847. *
  848. * @result 聊天室实例。
  849. *
  850. * \~english
  851. * Removes members from a chatroom.
  852. *
  853. * Only the chatroom owner or admin can call this method.
  854. *
  855. * This is a synchronous method and blocks the current thread.
  856. *
  857. * @param aMembers The users to be removed from the chatroom.
  858. * @param aChatroomId The chatroom ID.
  859. * @param pError The error information if the method fails: Error.
  860. *
  861. * @result The chatroom instance.
  862. */
  863. - (EMChatroom *_Nullable )removeMembers:(NSArray<NSString *> *_Nonnull)aMembers
  864. fromChatroom:(NSString *_Nonnull)aChatroomId
  865. error:(EMError **_Nullable )pError;
  866. /**
  867. * \~chinese
  868. * 将成员移出聊天室。
  869. *
  870. * 仅聊天室所有者和管理员可调用此方法。
  871. *
  872. * 异步方法。
  873. *
  874. * @param aMembers 要移出的用户列表。
  875. * @param aChatroomId 聊天室 ID。
  876. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  877. *
  878. *
  879. * \~english
  880. * Removes members from a chatroom.
  881. *
  882. * Only the chatroom owner or admin can call this method.
  883. *
  884. * This is an asynchronous method.
  885. *
  886. * @param aMembers The users to be removed from the chatroom.
  887. * @param aChatroomId The chatroom ID.
  888. * @param aCompletionBlock The completion block, which contains the error message if the method call fails.
  889. *
  890. */
  891. - (void)removeMembers:(NSArray<NSString *> *_Nonnull)aMembers
  892. fromChatroom:(NSString *_Nonnull)aChatroomId
  893. completion:(void (^_Nullable )(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
  894. /**
  895. * \~chinese
  896. * 将用户加入聊天室黑名单。
  897. *
  898. * 仅聊天室所有者有权限调用此方法。
  899. *
  900. * 同步方法,会阻塞当前线程。
  901. *
  902. * @param aMembers 要加入黑名单的用户。
  903. * @param aChatroomId 聊天室 ID。
  904. * @param pError 错误信息。
  905. *
  906. * @result 聊天室实例。
  907. *
  908. * \~english
  909. * Adds users to the chatroom's blocklist.
  910. *
  911. * Only the chatroom owner can call this method.
  912. *
  913. * This is a synchronous method and blocks the current thread.
  914. *
  915. * @param aMembers The users to be added to the blocklist.
  916. * @param aChatroomId The chatroom ID.
  917. * @param pError The error information if the method fails: Error.
  918. *
  919. * @result The chatroom instance.
  920. */
  921. - (EMChatroom *_Nullable )blockMembers:(NSArray<NSString *> *_Nonnull)aMembers
  922. fromChatroom:(NSString *_Nonnull)aChatroomId
  923. error:(EMError **_Nullable )pError;
  924. /**
  925. * \~chinese
  926. * 将用户加入聊天室黑名单。
  927. *
  928. * 仅聊天室所有者有权限调用此方法。
  929. *
  930. * 异步方法。
  931. *
  932. * @param aMembers 要加入黑名单的用户。
  933. * @param aChatroomId 聊天室 ID。
  934. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  935. *
  936. *
  937. * \~english
  938. * Adds users to the chatroom's blocklist.
  939. *
  940. * Only the chatroom owner can call this method.
  941. *
  942. * This is an asynchronous method.
  943. *
  944. * @param aMembers The users to be added to the chatroom.
  945. * @param aChatroomId The chatroom ID.
  946. * @param aCompletionBlock The completion block, which contains the error message if the method call fails.
  947. *
  948. */
  949. - (void)blockMembers:(NSArray<NSString *> *_Nonnull)aMembers
  950. fromChatroom:(NSString *_Nonnull)aChatroomId
  951. completion:(void (^_Nullable )(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
  952. /**
  953. * \~chinese
  954. * 从聊天室黑名单中移除用户。
  955. *
  956. * 仅聊天室所有者有权限调用此方法。
  957. *
  958. * 同步方法,会阻塞当前线程。
  959. *
  960. * @param aMembers 要从黑名单中移除的用户名列表。
  961. * @param aChatroomId 聊天室 ID。
  962. * @param pError 错误信息
  963. *
  964. * @result 聊天室实例。
  965. *
  966. * \~english
  967. * Removes users from chatroom blocklist.
  968. *
  969. * Only the chatroom owner can call this method.
  970. *
  971. * This is a synchronous method and blocks the current thread.
  972. *
  973. * @param aMembers The users to be removed from the blocklist.
  974. * @param aChatroomId The chatroom ID.
  975. * @param pError The error information if the method fails: Error.
  976. *
  977. * @result The chatroom instance.
  978. */
  979. - (EMChatroom *_Nullable )unblockMembers:(NSArray<NSString *> *_Nonnull)aMembers
  980. fromChatroom:(NSString *_Nonnull)aChatroomId
  981. error:(EMError **_Nullable )pError;
  982. /**
  983. * \~chinese
  984. * 从聊天室黑名单中移除。
  985. *
  986. * 仅聊天室所有者有权限调用此方法。
  987. *
  988. * 异步方法。
  989. *
  990. * @param aMembers 要从黑名单中移除的用户名列表。
  991. * @param aChatroomId 聊天室 ID。
  992. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  993. *
  994. *
  995. * \~english
  996. * Removes users from the chatroom blocklist.
  997. *
  998. * Only the chatroom owner can call this method.
  999. *
  1000. * This is an asynchronous method.
  1001. *
  1002. * @param aMembers The users to be removed from the blocklist.
  1003. * @param aChatroomId The chatroom ID.
  1004. * @param aCompletionBlock The completion block, which contains the error message if the method call fails.
  1005. *
  1006. */
  1007. - (void)unblockMembers:(NSArray<NSString *> *_Nonnull)aMembers
  1008. fromChatroom:(NSString *_Nonnull)aChatroomId
  1009. completion:(void (^_Nullable )(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
  1010. /**
  1011. * \~chinese
  1012. * 变更聊天室所有者。
  1013. *
  1014. * 仅聊天室所有者可调用此方法。
  1015. *
  1016. * 同步方法,会阻塞当前线程。
  1017. *
  1018. * @param aChatroomId 聊天室 ID。
  1019. * @param aNewOwner 新聊天室所有者。
  1020. * @param pError 错误信息。
  1021. *
  1022. * @result 聊天室实例。
  1023. *
  1024. * \~english
  1025. * Changes the chatroom owner.
  1026. *
  1027. * Only the chatroom owner can call this method.
  1028. *
  1029. * This is a synchronous method and blocks the current thread.
  1030. *
  1031. * @param aChatroomId The chatroom ID.
  1032. * @param aNewOwner The new owner.
  1033. * @param pError The error information if the method fails: Error.
  1034. *
  1035. * @result The chatroom instance. See EMChatroom.
  1036. */
  1037. - (EMChatroom *_Nullable )updateChatroomOwner:(NSString *_Nonnull)aChatroomId
  1038. newOwner:(NSString *_Nonnull)aNewOwner
  1039. error:(EMError **_Nullable )pError;
  1040. /**
  1041. * \~chinese
  1042. * 变更聊天室所有者。
  1043. *
  1044. * 仅聊天室所有者可调用此方法。
  1045. *
  1046. * 异步方法。
  1047. *
  1048. * @param aChatroomId 聊天室 ID。
  1049. * @param aNewOwner 新聊天室所有者。
  1050. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  1051. *
  1052. *
  1053. * \~english
  1054. * Changes the chatroom owner.
  1055. *
  1056. * Only the chatroom owner can call this method.
  1057. *
  1058. * This is an asynchronous method.
  1059. *
  1060. * @param aChatroomId The chatroom ID.
  1061. * @param aNewOwner The new owner.
  1062. * @param aCompletionBlock The completion block, which contains the error message if the method call fails.
  1063. *
  1064. */
  1065. - (void)updateChatroomOwner:(NSString *_Nonnull)aChatroomId
  1066. newOwner:(NSString *_Nonnull)aNewOwner
  1067. completion:(void (^_Nullable )(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
  1068. /**
  1069. * \~chinese
  1070. * 添加聊天室管理员。
  1071. *
  1072. * 仅聊天室所有者可调用此方法。
  1073. *
  1074. * 同步方法,会阻塞当前线程。
  1075. *
  1076. * @param aAdmin 要添加的管理员。
  1077. * @param aChatroomId 聊天室 ID。
  1078. * @param pError 错误信息。
  1079. *
  1080. * @result 聊天室实例,详见 EMChatroom。
  1081. *
  1082. * \~english
  1083. * Adds a chatroom admin.
  1084. *
  1085. * Only the chatroom owner can call this method.
  1086. *
  1087. * This is a synchronous method and blocks the current thread.
  1088. *
  1089. * @param aAdmin The new admin.
  1090. * @param aChatroomId The chatroom ID.
  1091. * @param pError The error information if the method fails: Error.
  1092. *
  1093. * @result The chatroom instance. See EMChatroom.
  1094. */
  1095. - (EMChatroom *_Nullable )addAdmin:(NSString *_Nonnull)aAdmin
  1096. toChatroom:(NSString *_Nonnull)aChatroomId
  1097. error:(EMError **_Nullable )pError;
  1098. /**
  1099. * \~chinese
  1100. * 添加聊天室管理员。
  1101. *
  1102. * 仅聊天室所有者可调用此方法。
  1103. *
  1104. * 异步方法。
  1105. *
  1106. * @param aAdmin 要添加的聊天室管理员。
  1107. * @param aChatroomId 聊天室 ID。
  1108. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  1109. *
  1110. *
  1111. * \~english
  1112. * Adds a chatroom admin.
  1113. *
  1114. * Only the chatroom owner can call this method.
  1115. *
  1116. * This is an asynchronous method.
  1117. *
  1118. * @param aAdmin The new admin.
  1119. * @param aChatroomId The chatroom ID.
  1120. * @param aCompletionBlock The completion block, which contains the error message if the method call fails.
  1121. *
  1122. */
  1123. - (void)addAdmin:(NSString *_Nonnull)aAdmin
  1124. toChatroom:(NSString *_Nonnull)aChatroomId
  1125. completion:(void (^_Nullable )(EMChatroom *_Nullable aChatroomp, EMError *_Nullable aError))aCompletionBlock;
  1126. /**
  1127. * \~chinese
  1128. * 移除聊天室管理员。
  1129. *
  1130. * 仅聊天室所有者可调用此方法。
  1131. *
  1132. * 同步方法,会阻塞当前线程。
  1133. *
  1134. * @param aAdmin 要移除的聊天室管理员。
  1135. * @param aChatroomId 聊天室 ID。
  1136. * @param pError 错误信息
  1137. *
  1138. * @result 聊天室实例,详见 EMChatroom。
  1139. *
  1140. * \~english
  1141. * Removes a chatroom admin.
  1142. *
  1143. * Only the chatroom owner can call this method.
  1144. *
  1145. * This is a synchronous method and blocks the current thread.
  1146. *
  1147. * @param aAdmin The admin to be removed.
  1148. * @param aChatroomId The chatroom ID.
  1149. * @param pError The error information if the method fails: Error.
  1150. *
  1151. * @result The chatroom instance. See EMChatroom.
  1152. */
  1153. - (EMChatroom *_Nullable )removeAdmin:(NSString *_Nonnull)aAdmin
  1154. fromChatroom:(NSString *_Nonnull)aChatroomId
  1155. error:(EMError **_Nullable )pError;
  1156. /**
  1157. * \~chinese
  1158. * 移除聊天室管理员。
  1159. *
  1160. * 仅聊天室所有者可调用此方法。
  1161. *
  1162. * 异步方法。
  1163. *
  1164. * @param aAdmin 要添加的聊天室管理员。
  1165. * @param aChatroomId 聊天室 ID。
  1166. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  1167. *
  1168. *
  1169. * \~english
  1170. * Removes a chatroom admin.
  1171. *
  1172. * Only the chatroom owner and admin can call this method.
  1173. *
  1174. * This is an asynchronous method.
  1175. *
  1176. * @param aAdmin The admin to be removed.
  1177. * @param aChatroomId The chatroom ID.
  1178. * @param aCompletionBlock The completion block, which contains the error message if the method call fails.
  1179. *
  1180. */
  1181. - (void)removeAdmin:(NSString *_Nonnull)aAdmin
  1182. fromChatroom:(NSString *_Nonnull)aChatroomId
  1183. completion:(void (^_Nullable )(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
  1184. /**
  1185. * \~chinese
  1186. * 将一组成员禁言。
  1187. *
  1188. * 仅聊天室所有者和管理员可调用此方法。
  1189. *
  1190. * 同步方法,会阻塞当前线程。
  1191. *
  1192. * @param aMuteMembers 要禁言的成员列表。
  1193. * @param aMuteMilliseconds 禁言时长
  1194. * @param aChatroomId 聊天室 ID。
  1195. * @param pError 错误信息
  1196. *
  1197. * @result 聊天室实例,详见 EMChatroom。
  1198. *
  1199. * \~english
  1200. * Mutes chatroom members.
  1201. *
  1202. * Only the chatroom owner or admin can call this method.
  1203. *
  1204. * This is a synchronous method and blocks the current thread.
  1205. *
  1206. * @param aMuteMembers The list of members to mute.
  1207. * @param aMuteMilliseconds Muted time duration in millisecond.
  1208. * @param aChatroomId The chatroom ID.
  1209. * @param pError The error information if the method fails: Error.
  1210. *
  1211. * @result The chatroom instance. See EMChatroom.
  1212. */
  1213. - (EMChatroom *_Nullable )muteMembers:(NSArray<NSString *> *_Nonnull)aMuteMembers
  1214. muteMilliseconds:(NSInteger)aMuteMilliseconds
  1215. fromChatroom:(NSString *_Nonnull)aChatroomId
  1216. error:(EMError **_Nullable )pError;
  1217. /**
  1218. * \~chinese
  1219. * 将一组成员禁言。
  1220. *
  1221. * 仅聊天室所有者和管理员可调用此方法。
  1222. *
  1223. * 异步方法。
  1224. *
  1225. * @param aMuteMembers 要禁言的成员列表。
  1226. * @param aMuteMilliseconds 禁言时长
  1227. * @param aChatroomId 聊天室 ID。
  1228. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  1229. *
  1230. * \~english
  1231. * Mutes chatroom members.
  1232. *
  1233. * Only the chatroom owner or admin can call this method.
  1234. *
  1235. * This is an asynchronous method.
  1236. *
  1237. * @param aMuteMembers The list of mute.
  1238. * @param aMuteMilliseconds Muted time duration in millisecond
  1239. * @param aChatroomId The chatroom ID.
  1240. * @param aCompletionBlock The completion block, which contains the error message if the method call fails.
  1241. *
  1242. */
  1243. - (void)muteMembers:(NSArray<NSString *> *_Nonnull)aMuteMembers
  1244. muteMilliseconds:(NSInteger)aMuteMilliseconds
  1245. fromChatroom:(NSString *_Nonnull)aChatroomId
  1246. completion:(void (^_Nullable )(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
  1247. /**
  1248. * \~chinese
  1249. * 解除禁言。
  1250. *
  1251. * 仅聊天室所有者和管理员可调用此方法。
  1252. *
  1253. * 同步方法,会阻塞当前线程。
  1254. *
  1255. * @param aMuteMembers 解除禁言的用户列表。
  1256. * @param aChatroomId 聊天室 ID。
  1257. * @param pError 错误信息
  1258. *
  1259. * @result 聊天室实例,详见 EMChatroom。
  1260. *
  1261. * \~english
  1262. * Unmutes chatroom members.
  1263. *
  1264. * Only the chatroom owner or admin can call this method.
  1265. *
  1266. * This is a synchronous method and blocks the current thread.
  1267. *
  1268. * @param aMembers The list of members to unmute.
  1269. * @param aChatroomId The chatroom ID.
  1270. * @param pError The error information if the method fails: Error.
  1271. *
  1272. * @result The chatroom instance. See EMChatroom.
  1273. */
  1274. - (EMChatroom *_Nullable )unmuteMembers:(NSArray<NSString *> *_Nonnull)aMembers
  1275. fromChatroom:(NSString *_Nonnull)aChatroomId
  1276. error:(EMError **_Nullable )pError;
  1277. /**
  1278. * \~chinese
  1279. * 解除禁言。
  1280. *
  1281. * 仅聊天室所有者和管理员可调用此方法。
  1282. *
  1283. * 异步方法。
  1284. *
  1285. * @param aMuteMembers 被解除的列表
  1286. * @param aChatroomId 聊天室 ID。
  1287. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  1288. *
  1289. * \~english
  1290. * Unmutes chatroom members.
  1291. *
  1292. * Only the chatroom owner or admin can call this method.
  1293. *
  1294. * This is an asynchronous method.
  1295. *
  1296. * @param aMembers The list of unmute.
  1297. * @param aChatroomId The chatroom ID.
  1298. * @param aCompletionBlock The completion block, which contains the error message if the method call fails.
  1299. *
  1300. */
  1301. - (void)unmuteMembers:(NSArray<NSString *> *_Nonnull)aMembers
  1302. fromChatroom:(NSString *_Nonnull)aChatroomId
  1303. completion:(void (^_Nullable )(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
  1304. /**
  1305. * \~chinese
  1306. * 设置全员禁言。
  1307. *
  1308. * 仅聊天室所有者和管理员可调用此方法。
  1309. *
  1310. * 同步方法,会阻塞当前线程。
  1311. *
  1312. * @param aChatroomId 聊天室 ID。
  1313. * @param pError 错误信息
  1314. *
  1315. * @result 聊天室实例,详见 EMChatroom。
  1316. *
  1317. * \~english
  1318. * Mutes all members.
  1319. *
  1320. * Only the chatroom owner or admin can call this method.
  1321. *
  1322. * This is a synchronous method and blocks the current thread.
  1323. *
  1324. * @param aChatroomId The chatroom ID.
  1325. * @param pError The error information if the method fails: Error.
  1326. *
  1327. * @result The chatroom instance. See EMChatroom.
  1328. */
  1329. - (EMChatroom *_Nullable )muteAllMembersFromChatroom:(NSString *_Nonnull)aChatroomId
  1330. error:(EMError **_Nullable )pError;
  1331. /**
  1332. * \~chinese
  1333. * 设置全员禁言。
  1334. *
  1335. * 仅聊天室所有者和管理员可调用此方法。
  1336. *
  1337. * 异步方法。
  1338. *
  1339. * @param aChatroomId 聊天室 ID。
  1340. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  1341. *
  1342. * \~english
  1343. * Mutes all members.
  1344. *
  1345. * Only the chatroom owner or admin can call this method.
  1346. *
  1347. * This is an asynchronous method.
  1348. *
  1349. * @param aChatroomId The chatroom ID.
  1350. * @param aCompletionBlock The completion block, which contains the error message if the method call fails.
  1351. *
  1352. */
  1353. - (void)muteAllMembersFromChatroom:(NSString *_Nonnull)aChatroomId
  1354. completion:(void(^_Nullable )(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
  1355. /**
  1356. * \~chinese
  1357. * 解除全员禁言。
  1358. *
  1359. * 仅聊天室所有者和管理员可调用此方法。
  1360. *
  1361. * 同步方法,会阻塞当前线程。
  1362. *
  1363. * @param aChatroomId 聊天室 ID。
  1364. * @param pError 错误信息
  1365. *
  1366. * @result 聊天室实例,详见 EMChatroom。
  1367. *
  1368. * \~english
  1369. * Unmute all members.
  1370. *
  1371. * Only the chatroom owner or admin can call this method.
  1372. *
  1373. * This is a synchronous method and blocks the current thread.
  1374. *
  1375. * @param aChatroomId The chatroom ID.
  1376. * @param pError The error information if the method fails: Error.
  1377. *
  1378. * @result The chatroom instance. See EMChatroom.
  1379. */
  1380. - (EMChatroom *_Nullable )unmuteAllMembersFromChatroom:(NSString *_Nonnull)aChatroomId
  1381. error:(EMError **_Nullable )pError;
  1382. /**
  1383. * \~chinese
  1384. * 解除全员禁言。
  1385. *
  1386. * 仅聊天室所有者和管理员可调用此方法。
  1387. *
  1388. * 异步方法。
  1389. *
  1390. * @param aChatroomId 聊天室 ID。
  1391. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  1392. *
  1393. * \~english
  1394. * Unmute all members.
  1395. *
  1396. * Only the chatroom owner or admin can call this method.
  1397. *
  1398. * This is an asynchronous method.
  1399. *
  1400. * @param aChatroomId The chatroom ID.
  1401. * @param aCompletionBlock The completion block, which contains the error message if the method call fails.
  1402. *
  1403. */
  1404. - (void)unmuteAllMembersFromChatroom:(NSString *_Nonnull)aChatroomId
  1405. completion:(void(^_Nullable )(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
  1406. /**
  1407. * \~chinese
  1408. * 添加白名单。
  1409. *
  1410. * 仅聊天室所有者和管理员可调用此方法。
  1411. *
  1412. * 同步方法,会阻塞当前线程。
  1413. *
  1414. * @param aMembers 被添加的列表。
  1415. * @param aChatroomId 聊天室 ID。
  1416. * @param pError 错误信息
  1417. *
  1418. * @result 聊天室实例,详见 EMChatroom。
  1419. *
  1420. * \~english
  1421. * Adds users to the allowlist.
  1422. *
  1423. * Only the chatroom owner and admin can call this method.
  1424. *
  1425. * This is a synchronous method and blocks the current thread.
  1426. *
  1427. * @param aMembers The members to be added to the allowlist.
  1428. * @param aChatroomId The chatroom ID.
  1429. * @param pError The error information if the method fails: Error.
  1430. *
  1431. * @result The chatroom instance. See EMChatroom.
  1432. */
  1433. - (EMChatroom *_Nullable )addWhiteListMembers:(NSArray<NSString *> *_Nonnull)aMembers
  1434. fromChatroom:(NSString *_Nonnull)aChatroomId
  1435. error:(EMError **_Nullable )pError;
  1436. /**
  1437. * \~chinese
  1438. * 添加白名单。
  1439. *
  1440. * 仅聊天室所有者和管理员可调用此方法。
  1441. *
  1442. * 异步方法。
  1443. *
  1444. * @param aMembers 被添加的列表。
  1445. * @param aChatroomId 聊天室 ID。
  1446. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  1447. *
  1448. * \~english
  1449. * Adds members to the allowlist.
  1450. *
  1451. * Only the chatroom owner and admin can call this method.
  1452. *
  1453. * This is an asynchronous method.
  1454. *
  1455. * @param aMembers The members to be added to the allowlist.
  1456. * @param aChatroomId The chatroom ID.
  1457. * @param aCompletionBlock The completion block, which contains the error message if the method call fails.
  1458. *
  1459. */
  1460. - (void)addWhiteListMembers:(NSArray<NSString *> *_Nonnull)aMembers
  1461. fromChatroom:(NSString *_Nonnull)aChatroomId
  1462. completion:(void (^_Nullable )(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
  1463. /**
  1464. * \~chinese
  1465. * 移除白名单。
  1466. *
  1467. * 仅聊天室所有者和管理员可调用此方法。
  1468. *
  1469. * 同步方法,会阻塞当前线程。
  1470. *
  1471. * @param aMuteMembers 被移除的列表。
  1472. * @param aChatroomId 聊天室 ID。
  1473. * @param pError 错误信息。
  1474. *
  1475. * @result 聊天室实例,详见 EMChatroom。
  1476. *
  1477. * \~english
  1478. * Removes the members of the allowlist.
  1479. *
  1480. * Only the chatroom owner or admin can call this method.
  1481. *
  1482. * This is a synchronous method and blocks the current thread.
  1483. *
  1484. * @param aMembers The members to be removed from the allowlist.
  1485. * @param aChatroomId The chatroom ID.
  1486. * @param pError The error information if the method fails: Error.
  1487. *
  1488. * @result The chatroom instance. See EMChatroom.
  1489. */
  1490. - (EMChatroom *_Nullable )removeWhiteListMembers:(NSArray<NSString *> *_Nonnull)aMembers
  1491. fromChatroom:(NSString *_Nonnull)aChatroomId
  1492. error:(EMError **_Nullable )pError;
  1493. /**
  1494. * \~chinese
  1495. * 移除白名单。
  1496. *
  1497. * 仅聊天室所有者和管理员可调用此方法。
  1498. *
  1499. * 异步方法。
  1500. *
  1501. * @param aMembers 被移除的列表。
  1502. * @param aChatroomId 聊天室 ID。
  1503. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  1504. *
  1505. * \~english
  1506. * Removes members from the allowlist.
  1507. *
  1508. * Only the chatroom owner or admin can call this method.
  1509. *
  1510. * This is an asynchronous method.
  1511. *
  1512. * @param aMembers The members to be removed from the allowlist.
  1513. * @param aChatroomId The chatroom ID.
  1514. * @param aCompletionBlock The completion block, which contains the error message if the method call fails.
  1515. *
  1516. */
  1517. - (void)removeWhiteListMembers:(NSArray<NSString *> *_Nonnull)aMembers
  1518. fromChatroom:(NSString *_Nonnull)aChatroomId
  1519. completion:(void (^_Nullable )(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
  1520. /**
  1521. * \~chinese
  1522. * 修改聊天室公告。
  1523. *
  1524. * 仅聊天室所有者和管理员可调用此方法。
  1525. *
  1526. * 同步方法,会阻塞当前线程。
  1527. *
  1528. * @param aChatroomId 聊天室 ID。
  1529. * @param aAnnouncement 群公告。
  1530. * @param pError 错误信息。
  1531. *
  1532. * @result 聊天室实例,详见 EMChatroom。
  1533. *
  1534. * \~english
  1535. * Changes the announcement of the chatroom.
  1536. *
  1537. * Only the chatroom owner or admin can call this method.
  1538. *
  1539. * This is a synchronous method and blocks the current thread.
  1540. *
  1541. * @param aChatroomId The chatroom ID.
  1542. * @param aAnnouncement The announcement of the chatroom.
  1543. * @param pError The error information if the method fails: Error.
  1544. *
  1545. * @result The chatroom instance. See EMChatroom.
  1546. */
  1547. - (EMChatroom *_Nullable )updateChatroomAnnouncementWithId:(NSString *_Nonnull)aChatroomId
  1548. announcement:(NSString *_Nullable )aAnnouncement
  1549. error:(EMError **_Nullable )pError;
  1550. /**
  1551. * \~chinese
  1552. * 修改聊天室公告。
  1553. *
  1554. * 仅聊天室所有者和管理员可调用此方法。
  1555. *
  1556. * 异步方法。
  1557. *
  1558. * @param aChatroomId 聊天室 ID。
  1559. * @param aAnnouncement 群公告。
  1560. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  1561. *
  1562. * \~english
  1563. * Changes the announcement of chatroom.
  1564. *
  1565. * Only the chatroom owner or admin can call this method.
  1566. *
  1567. * This is an asynchronous method.
  1568. *
  1569. * @param aChatroomId The chatroom ID.
  1570. * @param aAnnouncement The announcement of the chatroom.
  1571. * @param aCompletionBlock The completion block, which contains the error message if the method call fails.
  1572. *
  1573. */
  1574. - (void)updateChatroomAnnouncementWithId:(NSString *_Nonnull)aChatroomId
  1575. announcement:(NSString *_Nullable)aAnnouncement
  1576. completion:(void (^_Nullable)(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
  1577. /**
  1578. * \~chinese
  1579. * 设置多个聊天室自定义属性。
  1580. *
  1581. * @note
  1582. * 该方法不允许覆盖其他成员设置的属性。
  1583. *
  1584. * 异步方法。
  1585. *
  1586. * @param roomId 聊天室 ID。
  1587. * @param attributes 聊天室自定义属性,为键值对(key-value)格式,key 为属性名称,value 为属性值。
  1588. * @param autoDelete 当前成员退出聊天室后是否自动删除该聊天室中其设置的所有聊天室自定义属性。
  1589. * - (默认)`YES`:是。
  1590. * - `NO`:否。
  1591. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。如果有部分 Key 失败,会返回 `failureKeys map`,`value` 是失败原因。
  1592. *
  1593. * \~english
  1594. * Sets custom attributes of the chat room.
  1595. *
  1596. * @note
  1597. * This method does not overwrite attributes set by others.
  1598. *
  1599. * This is an asynchronous method.
  1600. *
  1601. * @param roomId The chat room ID.
  1602. * @param attributes The custom chat room attributes in key-value pairs, where the key is the attribute name and the value is the attribute value.
  1603. * @param autoDelete Whether to delete the chat room attributes set by the member when he or she exits the chat room.
  1604. * - (Default)`YES`: Yes;
  1605. * - `NO`: No.
  1606. * @param aCompletionBlock The completion block, which contains the error message if the method call fails. If certain attribute keys fail to be added, the SDK returns `failureKeys map` in key-value format, where the key is the attribute key, and the value is the reason for the failure.
  1607. *
  1608. */
  1609. - (void)setChatroomAttributes:(NSString *_Nonnull)roomId attributes:(NSDictionary<NSString*,NSString*> *_Nonnull)keyValues autoDelete:(BOOL)autoDelete completionBlock:(void (^_Nullable)(EMError *_Nullable aError,NSDictionary<NSString*,EMError*> *_Nullable failureKeys))completionBlock ;
  1610. /**
  1611. * \~chinese
  1612. * 设置聊天室单个自定义属性。
  1613. *
  1614. * @note
  1615. * 该方法不允许覆盖其他成员设置的属性。
  1616. *
  1617. * 异步方法。
  1618. *
  1619. * @param roomId 聊天室 ID。
  1620. * @param key 聊天室属性 key,指定属性名。属性名不能超过 128 字符。每个聊天室最多可有 100 个属性。Key 支持以下字符集:
  1621. * • 26 个小写英文字母 a-z;
  1622. * • 26 个大写英文字母 A-Z;
  1623. * • 10 个数字 0-9;
  1624. * • “_”, “-”, “.”。
  1625. * @param value 聊天室属性值。每个属性值不超过 4096 字符,每个应用的聊天室属性总大小不能超过 10 GB。
  1626. * @param autoDelete 成员离开聊天室后是否自动删除该聊天室中其设置的所有聊天室自定义属性。
  1627. * - (默认)`YES`:是。
  1628. * - `NO`:否。
  1629. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。如果有部分 Key 失败,会返回 `failureKeys map`,`value` 是失败原因。
  1630. *
  1631. * \~english
  1632. * Sets a custom chat room attribute.
  1633. *
  1634. * @note
  1635. * This method does not overwrite attributes set by others.
  1636. *
  1637. * This is an asynchronous method.
  1638. *
  1639. * @param roomId The chat room ID.
  1640. * @param key The chat room attribute key that specifies the attribute name. The attribute name can contain 128 characters at most.
  1641. * A chat room can have a maximum of 100 custom attributes. The following character sets are supported:
  1642. * - 26 lowercase English letters (a-z)
  1643. * - 26 uppercase English letters (A-Z)
  1644. * - 10 numbers (0-9)
  1645. * - "_", "-", "."
  1646. * @param value The chat room attribute value. The attribute value can contain a maximum of 4096 characters. The total length of custom chat room attributes cannot exceed 10 GB for each app.
  1647. * @param autoDelete Whether to delete the custom chat room attributes set by the member when he or she exits the chat room.
  1648. * - (Default)`YES`: Yes;
  1649. * - `NO`: No.
  1650. * @param aCompletionBlock The completion block, which contains the error message if the method call fails. If certain attribute keys fail to be added, the SDK returns `failureKeys map` in key-value format, where the key is the attribute key, and the value is the reason for the failure.
  1651. *
  1652. */
  1653. - (void)setChatroomAttribute:(NSString *_Nonnull)roomId key:(NSString *_Nonnull)key value:(NSString *_Nonnull)value autoDelete:(BOOL)autoDelete completionBlock:(void (^_Nullable)(EMError *_Nullable aError))completionBlock;
  1654. /**
  1655. * \~chinese
  1656. * 强制设置多个聊天室自定义属性。
  1657. *
  1658. * @note
  1659. * 该方法可覆盖其他成员已设置的自定义属性。
  1660. *
  1661. * 异步方法。
  1662. *
  1663. * @param roomId 聊天室 ID。
  1664. * @param attributes 聊天室自定义属性,为键值对(key-value)格式,key 为属性名称,value 为属性值。
  1665. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。如果有部分 Key 失败,会返回 `failureKeys map`,`value` 是失败原因。
  1666. * \~english
  1667. * Sets custom chat room attributes forcibly.
  1668. *
  1669. * @note
  1670. * This method overwrites attributes set by others.
  1671. *
  1672. * This is an asynchronous method.
  1673. *
  1674. * @param roomId The chat room ID.
  1675. * @param attributes The custom chat room attributes in key-value pairs, where the key is the attribute name and the value is the attribute value.
  1676. * @param aCompletionBlock The completion block, which contains the error message if the method call fails. If certain attribute keys fail to be added, the SDK returns `failureKeys map` in key-value format, where the key is the attribute key, and the value is the reason for the failure.
  1677. *
  1678. */
  1679. - (void)setChatroomAttributesForced:(NSString *_Nonnull)roomId attributes:(NSDictionary<NSString*,NSString*> *_Nonnull)keyValues autoDelete:(BOOL)autoDelete completionBlock:(void (^_Nullable)(EMError *_Nullable aError,NSDictionary<NSString*,EMError*> *_Nullable failureKeys))completionBlock;
  1680. /**
  1681. * \~chinese
  1682. * 强制设置单个聊天室自定义属性。
  1683. *
  1684. * @note
  1685. * 该方法可覆盖其他成员已设置的自定义属性。
  1686. *
  1687. * 异步方法。
  1688. *
  1689. * @param roomId 聊天室 ID。
  1690. * @param key 聊天室属性 Key。属性名不能超过 128 字符。每个聊天室最多可有 100 个属性。Key 支持以下字符集:
  1691. * - 26 个小写英文字母 a-z;
  1692. * - 26 个大写英文字母 A-Z;
  1693. * - 10 个数字 0-9;
  1694. * - “_”, “-”, “.”。
  1695. * @param value 聊天室属性 value,属性值。每个属性值不超过 4096 字符,每个应用的聊天室属性总大小不能超过 10 GB。
  1696. * @param autoDelete 成员离开聊天室后是否自动删除该聊天室中其设置的所有聊天室自定义属性。
  1697. * - (默认)`YES`:是。
  1698. * - `NO`:否。
  1699. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。如果该方法调用失败,会包含调用失败的原因。如果有部分 Key 失败,会返回 `failureKeys map`,`value` 是失败原因。
  1700. *
  1701. * \~english
  1702. * Sets a custom chat room attribute forcibly.
  1703. *
  1704. * @note
  1705. * This method overwrites attributes set by others.
  1706. *
  1707. * This is an asynchronous method.
  1708. *
  1709. * @param roomId The chat room ID.
  1710. * @param key The chat room attribute key that specifies the attribute name. The attribute name can contain 128 characters at most.
  1711. * A chat room can have a maximum of 100 custom attributes. The following character sets are supported:
  1712. * - 26 lowercase English letters (a-z)
  1713. * - 26 uppercase English letters (A-Z)
  1714. * - 10 numbers (0-9)
  1715. * - "_", "-", "."
  1716. * @param value The attribute value to set. A single Value can not exceed 4096 characters. The total attribute can not exceed 10 GB.
  1717. * @param autoDelete Whether to delete the chat room attributes set by the member when he or she exits the chat room.
  1718. * - (Default)`YES`: Yes;
  1719. * - `NO`: No.
  1720. * @param aCompletionBlock The completion block, which contains the error message if the method call fails. If certain attribute keys fail to be added, the SDK returns `failureKeys map` in key-value format, where the key is the attribute key, and the value is the reason for the failure.
  1721. *
  1722. */
  1723. - (void)setChatroomAttributeForced:(NSString *_Nonnull)roomId key:(NSString *_Nonnull)key value:(NSString *_Nonnull)value autoDelete:(BOOL)autoDelete completionBlock:(void (^_Nullable)(EMError *_Nullable aError))completionBlock;
  1724. /**
  1725. * \~chinese
  1726. * 删除多个聊天室自定义属性。
  1727. *
  1728. * @note
  1729. * 该方法不删除其他成员设置的属性。
  1730. *
  1731. * 异步方法。
  1732. *
  1733. * @param aChatroomId 聊天室 ID。
  1734. * @param attributes 要删除的聊天室自定义属性的 key 列表。
  1735. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。如果该方法调用失败,会包含调用失败的原因。如果有部分 Key 失败,会返回 `failureKeys map`,`value` 是失败原因。
  1736. *
  1737. * \~english
  1738. * Removes custom chat room attributes.
  1739. *
  1740. * @note
  1741. * This method does not remove attributes set by other members.
  1742. *
  1743. * This is an asynchronous method.
  1744. *
  1745. * @param aChatroomId The chat room ID.
  1746. * @param attributes The keys of the chat room attributes to remove.
  1747. * @param aCompletionBlock The completion block, which contains the error message if the method call fails. If certain attribute keys fail to be added, the SDK returns `failureKeys map` in key-value format, where the key is the attribute key, and the value is the reason for the failure.
  1748. *
  1749. */
  1750. - (void)removeChatroomAttributes:(NSString *_Nonnull)roomId attributes:(NSArray <__kindof NSString*> * _Nonnull)keyValues completionBlock:(void (^_Nullable)(EMError *_Nullable aError,NSDictionary<NSString*,EMError*> *_Nullable failureKeys))completionBlock;
  1751. /**
  1752. * \~chinese
  1753. * 删除单个聊天室自定义属性。
  1754. *
  1755. * @note
  1756. * 该方法不删除其他成员设置的属性。
  1757. *
  1758. * 异步方法。
  1759. *
  1760. * @param aChatroomId 聊天室 ID。
  1761. * @param key 要删除聊天室自定义属性键值对的 key。
  1762. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。如果有部分 Key 失败,会返回 `failureKeys map`,`value` 是失败原因。
  1763. *
  1764. * \~english
  1765. * Removes a custom chat room attribute.
  1766. *
  1767. * @note
  1768. * This method does not remove attributes set by other members.
  1769. *
  1770. * This is an asynchronous method.
  1771. *
  1772. * @param aChatroomId The chat room ID.
  1773. * @param key The key of the chat room attribute to remove.
  1774. * @param aCompletionBlock The completion block, which contains the error message if the method call fails. If certain attribute keys fail to be added, the SDK returns `failureKeys map` in key-value format, where the key is the attribute key, and the value is the reason for the failure.
  1775. *
  1776. */
  1777. - (void)removeChatroomAttribute:(NSString *_Nonnull)roomId key:(NSString * _Nonnull)key completionBlock:(void (^_Nullable)(EMError *_Nullable aError))completionBlock;
  1778. /**
  1779. * \~chinese
  1780. * 强制删除多个聊天室自定义属性。
  1781. *
  1782. * @note
  1783. * 该方法支持删除其他成员设置的属性。
  1784. *
  1785. * 异步方法。
  1786. *
  1787. * @param aChatroomId 聊天室 ID。
  1788. * @param keyValues 要删除聊天室自定义属性的 key 数组。
  1789. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  1790. *
  1791. * \~english
  1792. * Removes custom chat room attributes forcibly.
  1793. *
  1794. * @note
  1795. * This method removes attributes set by other members.
  1796. *
  1797. * This is an asynchronous method.
  1798. *
  1799. * @param aChatroomId The chat room ID.
  1800. * @param keyValues The array of chat room attribute keys.
  1801. * @param aCompletionBlock The completion block, which contains the error message if the method call fails.
  1802. *
  1803. */
  1804. - (void)removeChatroomAttributesForced:(NSString *_Nonnull)roomId attributes:(NSArray <__kindof NSString*> * _Nonnull)keyValues completionBlock:(void (^_Nullable)(EMError *_Nullable aError,NSDictionary<NSString*,EMError*> *_Nullable failureKeys))completionBlock;
  1805. /**
  1806. * \~chinese
  1807. * 强制删除聊天室自定义属性。
  1808. *
  1809. * @note
  1810. * 该方法支持删除其他成员设置的属性。
  1811. *
  1812. * 异步方法。
  1813. *
  1814. * @param aChatroomId 聊天室 ID。
  1815. * @param key 要删除聊天室自定义属性键值对的 key。
  1816. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。如果有部分 Key 失败,会返回 `failureKeys map`,`value` 是失败原因。
  1817. *
  1818. * \~english
  1819. * Removes custom chat room attributes forcibly.
  1820. *
  1821. * @note
  1822. * This method removes attributes set by other members.
  1823. *
  1824. * This is an asynchronous method.
  1825. *
  1826. * @param aChatroomId The chat room ID.
  1827. * @param key The keys of the custom chat room attributes to remove.
  1828. * @param aCompletionBlock The completion block, which contains the error message if the method call fails. If certain attribute keys fail to be added, the SDK returns `failureKeys map` in key-value format, where the key is the attribute key and the value is the reason for the failure.
  1829. *
  1830. */
  1831. - (void)removeChatroomAttributeForced:(NSString *_Nonnull)roomId key:(NSString * _Nonnull)key completionBlock:(void (^_Nullable)(EMError *_Nullable aError))completionBlock;
  1832. /**
  1833. * \~chinese
  1834. * 获取所有聊天室属性。
  1835. * 异步方法。
  1836. *
  1837. * @param roomId 聊天室 ID。
  1838. * @param keys 聊天室的属性keys。传nil会返回全部
  1839. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因,成功返回所有键值对。
  1840. *
  1841. * \~english
  1842. * Fetch the properties of chatroom form sever.
  1843. * This is an asynchronous method.
  1844. *
  1845. * @param roomId The chatroom ID.
  1846. * @param keys Chat room attribute keys.Empty callback all.
  1847. * @param aCompletionBlock The completion block, which contains keyValues and the error message if the method call fails.
  1848. *
  1849. */
  1850. - (void)fetchChatroomAttributes:(NSString *_Nonnull)roomId keys:(NSArray <__kindof NSString *> * _Nullable)keys completion:(void (^_Nullable)(EMError *_Nullable aError,NSDictionary<NSString*,NSString*> *_Nullable properties ))completionBlock;
  1851. /**
  1852. * \~chinese
  1853. * 获取所有聊天室属性。
  1854. * 异步方法。
  1855. *
  1856. * @param roomId 聊天室 ID。
  1857. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因,成功返回所有键值对。
  1858. *
  1859. * \~english
  1860. * Fetch the properties of chatroom form sever.
  1861. * This is an asynchronous method.
  1862. *
  1863. * @param roomId The chatroom ID.
  1864. * @param aCompletionBlock The completion block, which contains keyValues and the error message if the method call fails.
  1865. *
  1866. */
  1867. - (void)fetchChatroomAllAttributes:(NSString * _Nonnull)roomId completion:(void (^ _Nullable)(EMError * _Nullable error,NSDictionary<NSString*,NSString*> * _Nullable properties))completionBlock;
  1868. #pragma mark - EM_DEPRECATED_IOS 3.3.0
  1869. /**
  1870. * \~chinese
  1871. * 获取聊天室详情。
  1872. *
  1873. * 已废弃,请用 {@link IEMChatroomManager getChatroomSpecificationFromServerWithId:error:} 代替。
  1874. *
  1875. * 同步方法,会阻塞当前线程。
  1876. *
  1877. * @param aChatroomId 聊天室 ID。
  1878. * @param aIncludeMembersList 是否获取成员列表,为 YES 时,一次性返回 200 个以内成员。
  1879. * @param pError 错误信息。
  1880. *
  1881. * @result 聊天室实例,详见 EMChatroom。
  1882. *
  1883. * \~english
  1884. * Fetches the chatroom's specification.
  1885. *
  1886. * Deprecated, please use {@link IEMChatroomManager getChatroomSpecificationFromServerWithId:error:} instead.
  1887. *
  1888. * This is a synchronous method and blocks the current thread.
  1889. *
  1890. * @param aChatroomId The chatroom ID.
  1891. * @param aIncludeMembersList Whether to get the member list. If you set the parameter as YES, it will return no more than 200 members.
  1892. * @param pError The error information if the method fails: Error.
  1893. *
  1894. * @result The chatroom instance. See EMChatroom.
  1895. */
  1896. - (EMChatroom *)fetchChatroomInfo:(NSString *)aChatroomId
  1897. includeMembersList:(BOOL)aIncludeMembersList
  1898. error:(EMError **)pError EM_DEPRECATED_IOS(3_1_0, 3_3_0, "Use -IEMChatroomManager getChatroomSpecificationFromServerWithId:error: instead");
  1899. /**
  1900. * \~chinese
  1901. * 获取聊天室详情。
  1902. *
  1903. * 已废弃,请用 {@link IEMChatroomManager getChatroomSpecificationFromServerWithId:completion:} 代替。
  1904. *
  1905. * @param aChatroomId 聊天室 ID。
  1906. * @param aIncludeMembersList 是否获取成员列表,为 YES 时,返回 200 个成员
  1907. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  1908. *
  1909. * \~english
  1910. * Fetches chat room specifications.
  1911. *
  1912. * Deprecated, please use {@link IEMChatroomManager getChatroomSpecificationFromServerWithId:completion:} instead.
  1913. *
  1914. * @param aChatroomId The chatroom ID.
  1915. * @param aIncludeMembersList Whether to get the member list. If you set the parameter as YES, it will return 200 members.
  1916. * @param aCompletionBlock The completion block, which contains the error message if the method call fails.
  1917. *
  1918. */
  1919. - (void)getChatroomSpecificationFromServerByID:(NSString *)aChatroomId
  1920. includeMembersList:(BOOL)aIncludeMembersList
  1921. completion:(void (^)(EMChatroom *aChatroom, EMError *aError))aCompletionBlock EM_DEPRECATED_IOS(3_1_0, 3_3_0, "Use -IEMChatroomManager getChatroomSpecificationFromServerWithId:completion: instead");
  1922. #pragma mark - EM_DEPRECATED_IOS 3.2.3
  1923. /**
  1924. * \~chinese
  1925. * 添加回调代理。
  1926. *
  1927. * 已废弃,请用 {@link IEMChatroomManager addDelegate:delegateQueue:} 代替。
  1928. *
  1929. * @param aDelegate 要添加的代理。
  1930. *
  1931. * \~english
  1932. * Adds delegate.
  1933. *
  1934. * Deprecated, please use {@link IEMChatroomManager addDelegate:delegateQueue:} instead.
  1935. *
  1936. * @param aDelegate The delegate you want to add.
  1937. */
  1938. - (void)addDelegate:(id<EMChatroomManagerDelegate>)aDelegate EM_DEPRECATED_IOS(3_1_0, 3_2_2, "Use -IEMChatroomManager addDelegate:delegateQueue: instead");
  1939. #pragma mark - EM_DEPRECATED_IOS < 3.2.3
  1940. /**
  1941. * \~chinese
  1942. * 从服务器获取所有的聊天室。
  1943. *
  1944. * 已废弃,请用 {@link getChatroomsFromServerWithPage} 代替。
  1945. *
  1946. * 同步方法,会阻塞当前线程。
  1947. *
  1948. * @param pError 出错信息。
  1949. *
  1950. * @result 聊天室列表,详见 <EMChatroom>。
  1951. *
  1952. * \~english
  1953. * Gets all the chatrooms from the server.
  1954. *
  1955. * Deprecated, please use {@link getChatroomsFromServerWithPage} instead.
  1956. *
  1957. * This is a synchronous method and blocks the current thread.
  1958. *
  1959. * @param pError The error information if the method fails: Error.
  1960. *
  1961. * @result The chat room list.
  1962. */
  1963. - (NSArray *)getAllChatroomsFromServerWithError:(EMError **)pError __deprecated_msg("Use -getChatroomsFromServerWithPage instead");
  1964. /**
  1965. * \~chinese
  1966. * 从服务器获取所有的聊天室。
  1967. *
  1968. * 已废弃,请用 {@link getChatroomsFromServerWithPage} 代替。
  1969. *
  1970. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  1971. *
  1972. * \~english
  1973. * Gets all the chatrooms from server.
  1974. *
  1975. * Deprecated, please use {@link getChatroomsFromServerWithPage} instead.
  1976. *
  1977. * @param aCompletionBlock The completion block, which contains the error message if the method call fails.
  1978. *
  1979. */
  1980. - (void)getAllChatroomsFromServerWithCompletion:(void (^)(NSArray *aList, EMError *aError))aCompletionBlock __deprecated_msg("Use -getChatroomsFromServerWithPage instead");
  1981. /**
  1982. * \~chinese
  1983. * 从服务器获取所有的聊天室。
  1984. *
  1985. * 已废弃,请用 {@link getAllChatroomsFromServerWithCompletion} 代替。
  1986. *
  1987. * @param aSuccessBlock 成功的回调。
  1988. * @param aFailureBlock 失败的回调。
  1989. *
  1990. * \~english
  1991. * Gets all the chatrooms from the server.
  1992. *
  1993. * Deprecated, please use {@link getAllChatroomsFromServerWithCompletion} instead.
  1994. *
  1995. * @param aSuccessBlock The callback block of success.
  1996. * @param aFailureBlock The callback block of failure, which contains the error message if the method fails.
  1997. *
  1998. */
  1999. - (void)asyncGetAllChatroomsFromServer:(void (^)(NSArray *aList))aSuccessBlock
  2000. failure:(void (^)(EMError *aError))aFailureBlock __deprecated_msg("Use -getAllChatroomsFromServerWithCompletion: instead");
  2001. /**
  2002. * \~chinese
  2003. * 加入一个聊天室。
  2004. *
  2005. * 已废弃,请用 {@link joinChatroom:completion:} 代替。
  2006. *
  2007. * @param aChatroomId 聊天室的 ID。
  2008. * @param aSuccessBlock 成功的回调。
  2009. * @param aFailureBlock 失败的回调。
  2010. *
  2011. *
  2012. * \~english
  2013. * Joins a chatroom.
  2014. *
  2015. * Deprecated, please use {@link joinChatroom:completion:} instead.
  2016. *
  2017. * @param aChatroomId The chatroom ID.
  2018. * @param aSuccessBlock The callback block of success.
  2019. * @param aFailureBlock The callback block of failure, which contains the error message if the method fails.
  2020. *
  2021. */
  2022. - (void)asyncJoinChatroom:(NSString *)aChatroomId
  2023. success:(void (^)(EMChatroom *aRoom))aSuccessBlock
  2024. failure:(void (^)(EMError *aError))aFailureBlock __deprecated_msg("Use -joinChatroom:completion: instead");
  2025. /**
  2026. * \~chinese
  2027. * 退出聊天室。
  2028. *
  2029. * 已废弃,请用 {@link leaveChatroom:completion:} 代替。
  2030. *
  2031. * @param aChatroomId 聊天室 ID。
  2032. * @param aSuccessBlock 成功的回调。
  2033. * @param aFailureBlock 失败的回调。
  2034. *
  2035. * @result 退出的聊天室。
  2036. *
  2037. * \~english
  2038. * Leaves a chatroom.
  2039. *
  2040. * Deprecated, please use {@link leaveChatroom:completion:} instead.
  2041. *
  2042. * @param aChatroomId The chatroom ID.
  2043. * @param aSuccessBlock The callback block of success.
  2044. * @param aFailureBlock The callback block of failure, which contains the error message if the method fails.
  2045. *
  2046. * @result Leaved chatroom
  2047. */
  2048. - (void)asyncLeaveChatroom:(NSString *)aChatroomId
  2049. success:(void (^)(EMChatroom *aRoom))aSuccessBlock
  2050. failure:(void (^)(EMError *aError))aFailureBlock __deprecated_msg("Use -leaveChatroom:completion: instead");
  2051. /**
  2052. * \~chinese
  2053. * 获取聊天室详情。
  2054. *
  2055. * 已废弃,请用 {@link getChatroomSpecificationFromServerByID:includeMembersList:completion:} 代替。
  2056. *
  2057. * @param aChatroomId 聊天室 ID。
  2058. * @param aIncludeMembersList 是否获取成员列表。
  2059. * @param aSuccessBlock 成功的回调。
  2060. * @param aFailureBlock 失败的回调。
  2061. *
  2062. * \~english
  2063. * Fetches chatroom's specification.
  2064. *
  2065. * Deprecated, please use {@link getChatroomSpecificationFromServerByID:includeMembersList:completion:} instead.
  2066. *
  2067. * @param aChatroomId The chatroom ID.
  2068. * @param aIncludeMembersList Whether to get member list.
  2069. * @param aSuccessBlock The callback block of success.
  2070. * @param aFailureBlock The callback block of failure, which contains the error message if the method fails.
  2071. *
  2072. */
  2073. - (void)asyncFetchChatroomInfo:(NSString *)aChatroomId
  2074. includeMembersList:(BOOL)aIncludeMembersList
  2075. success:(void (^)(EMChatroom *aChatroom))aSuccessBlock
  2076. failure:(void (^)(EMError *aError))aFailureBlock __deprecated_msg("Use -getChatroomSpecificationFromServerByID:includeMembersList:completion: instead");
  2077. @end