IEMGroupManager.h 90 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598
  1. /**
  2. * \~chinese
  3. * @header IEMGroupManager.h
  4. * @abstract 群组相关操作类。
  5. * @author Hyphenate
  6. * @version 3.00
  7. *
  8. * \~english
  9. * @header IEMGroupManager.h
  10. * @abstract This protocol defines the group operations.
  11. * @author Hyphenate
  12. * @version 3.00
  13. */
  14. #import <Foundation/Foundation.h>
  15. #import "EMCommonDefs.h"
  16. #import "EMGroupManagerDelegate.h"
  17. #import "EMGroup.h"
  18. #import "EMGroupOptions.h"
  19. #import "EMCursorResult.h"
  20. #import "EMGroupSharedFile.h"
  21. /**
  22. * \~chinese
  23. * 群组相关操作类。
  24. *
  25. * \~english
  26. * The group operations.
  27. */
  28. @protocol IEMGroupManager <NSObject>
  29. @required
  30. #pragma mark - Delegate
  31. /**
  32. * \~chinese
  33. * 添加回调代理。
  34. *
  35. * @param aDelegate 要添加的代理。
  36. * @param aQueue 代理执行的队列,如果是空值,则在主线程。
  37. *
  38. * \~english
  39. * Adds delegate.
  40. *
  41. * @param aDelegate The delegate to be added.
  42. * @param aQueue (optional) The queue of calling delegate methods. Pass in nil to run on main thread.
  43. */
  44. - (void)addDelegate:(id<EMGroupManagerDelegate> _Nonnull)aDelegate
  45. delegateQueue:(dispatch_queue_t _Nullable )aQueue;
  46. /**
  47. * \~chinese
  48. * 移除回调代理。
  49. *
  50. * @param aDelegate 要移除的代理。
  51. *
  52. * \~english
  53. * Removes delegate.
  54. *
  55. * @param aDelegate The delegate to be removed.
  56. */
  57. - (void)removeDelegate:(id _Nonnull)aDelegate;
  58. #pragma mark - Get Group
  59. /**
  60. * \~chinese
  61. * 获取用户所有群组。
  62. *
  63. * @result 群组列表。
  64. *
  65. * \~english
  66. * Gets all groups.
  67. *
  68. * @result The group list.
  69. *
  70. */
  71. - (NSArray<EMGroup *> *_Nullable )getJoinedGroups;
  72. /**
  73. * \~chinese
  74. * 从内存中获取屏蔽了推送的群组 ID 列表。
  75. *
  76. * @param pError 错误信息。
  77. *
  78. * @result 群组 ID 列表。
  79. * \~english
  80. * Gets the list of groups which have disabled Apple Push Notification Service.
  81. *
  82. * @param pError The error information if the method fails: Error.
  83. *
  84. * @result The group ID list.
  85. */
  86. - (NSArray *)getGroupsWithoutPushNotification:(EMError **)pError EM_DEPRECATED_IOS(3_3_2, 3_8_3, "Use -IEMPushManager::noPushGroups");
  87. #pragma mark - Get group from server
  88. /**
  89. * \~chinese
  90. * 按数目从服务器获取自己加入的群组。
  91. *
  92. * 这里需要注意的是:
  93. * - 每次调用只返回一页的数据。首次调用传空值,会从最新的第一条开始取;
  94. * - aPageSize 是这次接口调用期望返回的列表数据个数,如当前在最后一页,返回的数据会是 count < aPageSize;
  95. * - 列表页码 aPageNum 是方便服务器分页查询返回,对于数据量未知且很大的情况,分页获取,服务器会根据每次的页数和每次的pagesize 返回数据,直到返回所有数据。
  96. *
  97. * 同步方法,会阻塞当前线程。
  98. *
  99. * @param aPageNum 获取自己加入群的游标,首次调用传空。
  100. * @param aPageSize 期望返回结果的数量, 如果小于 0 则一次返回所有结果。
  101. * @param pError 出错信息。
  102. *
  103. * @result 群组列表。
  104. *
  105. * \~english
  106. * Gets pagesize number group you joined from the server.
  107. *
  108. * This is a synchronous method and blocks the current thread.
  109. *
  110. * @param aPageNum Gets the cursor to join the group. Sets the parameter as nil for the first time.
  111. * @param aPageSize The number of results expected to be returned. If <0 then all results will be returned at once
  112. * @param pError The error information if the method fails: Error.
  113. *
  114. * @result The Group list.
  115. */
  116. - (NSArray<EMGroup *> *_Nullable )getJoinedGroupsFromServerWithPage:(NSInteger)aPageNum
  117. pageSize:(NSInteger)aPageSize
  118. error:(EMError **_Nullable )pError;
  119. /**
  120. * \~chinese
  121. * 从服务器获取指定范围内的公开群。
  122. *
  123. * 同步方法,会阻塞当前线程。
  124. *
  125. * @param aCursor 获取公开群的游标,首次调用传空。
  126. * @param aPageSize 期望返回结果的数量, 如果小于 0 则一次返回所有结果。
  127. * @param pError 出错信息。
  128. *
  129. * @result 获取的公开群结果。
  130. *
  131. * \~english
  132. * Gets the public groups with the specified range from the server.
  133. *
  134. * This is a synchronous method and blocks the current thread.
  135. *
  136. * @param aCursor The cursor to join the group. Sets the parameter as nil for the first time.
  137. * @param aPageSize The number of results expected to be returned. If the number is less than 0 then all results will be returned at once.
  138. * @param pError The error information if the method fails: Error.
  139. *
  140. * @result The result.
  141. */
  142. - (EMCursorResult<EMGroup*> *_Nullable)getPublicGroupsFromServerWithCursor:(NSString *_Nullable)aCursor
  143. pageSize:(NSInteger)aPageSize
  144. error:(EMError **_Nullable)pError;
  145. /**
  146. * \~chinese
  147. * 从服务器获取指定范围内的公开群。
  148. *
  149. * 异步方法。
  150. *
  151. * @param aCursor 获取公开群的游标,首次调用传空。
  152. * @param aPageSize 期望返回结果的数量, 如果小于 0 则一次返回所有结果。
  153. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  154. *
  155. *
  156. * \~english
  157. * Gets public groups with the specified range from the server.
  158. *
  159. * This is an asynchronous method.
  160. *
  161. * @param aCursor Gets the cursor to join the group. Sets the parameter as nil for the first time.
  162. * @param aPageSize The number of results expected to be returned. If the number is less than 0 then all results will be returned at once.
  163. * @param aCompletionBlock The completion block, which contains the error message if the method fails.
  164. *
  165. */
  166. - (void)getPublicGroupsFromServerWithCursor:(NSString *_Nullable)aCursor
  167. pageSize:(NSInteger)aPageSize
  168. completion:(void (^_Nullable)(EMCursorResult<EMGroup*> *_Nullable aResult, EMError *_Nullable aError))aCompletionBlock;
  169. /**
  170. * \~chinese
  171. * 根据群组 ID 搜索公开群。
  172. *
  173. * 同步方法,会阻塞当前线程。
  174. *
  175. * @param aGroundId 群组 ID。
  176. * @param pError 错误信息。
  177. *
  178. * @result 搜索到的群组。
  179. *
  180. * \~english
  181. * Searches a public group with the group ID.
  182. *
  183. * This is a synchronous method and blocks the current thread.
  184. *
  185. * @param aGroundId The group ID.
  186. * @param pError The error information if the method fails: Error.
  187. *
  188. * @result The groups searched.
  189. */
  190. - (EMGroup * _Nullable)searchPublicGroupWithId:(NSString *_Nonnull)aGroundId
  191. error:(EMError **_Nullable)pError;
  192. /**
  193. * \~chinese
  194. * 根据群组 ID 搜索公开群。
  195. *
  196. * @param aGroundId 群组 ID。
  197. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  198. *
  199. *
  200. * \~english
  201. * Searches public group with group ID.
  202. *
  203. * @param aGroundId The group ID.
  204. * @param aCompletionBlock The completion block, which contains the error message if the method fails.
  205. *
  206. */
  207. - (void)searchPublicGroupWithId:(NSString *_Nonnull)aGroundId
  208. completion:(void (^_Nullable)(EMGroup *aGroup, EMError *_Nullable aError))aCompletionBlock;
  209. #pragma mark - Create
  210. /**
  211. * \~chinese
  212. * 创建群组。
  213. *
  214. * 同步方法,会阻塞当前线程。
  215. *
  216. * @param aSubject 群组名称。
  217. * @param aDescription 群组描述。
  218. * @param aInvitees 群组成员,不包括创建者自己。
  219. * @param aMessage 加入群组的邀请消息。
  220. * @param aSetting 群组属性。
  221. * @param pError 出错信息。
  222. *
  223. * @result 群组实例。
  224. *
  225. * \~english
  226. * Creates a group.
  227. *
  228. * This is a synchronous method and blocks the current thread.
  229. *
  230. * @param aSubject The subject of the group.
  231. * @param aDescription The description of the group.
  232. * @param aInvitees The members of the group. Do not include the creator.
  233. * @param aMessage The invitation message.
  234. * @param aSetting The group options.
  235. * @param pError The error information if the method fails: Error.
  236. *
  237. * @result The group instance.
  238. */
  239. - (EMGroup * _Nullable)createGroupWithSubject:(NSString *_Nullable)aSubject
  240. description:(NSString *_Nullable)aDescription
  241. invitees:(NSArray<NSString *> * _Nullable)aInvitees
  242. message:(NSString *_Nullable)aMessage
  243. setting:(EMGroupOptions *_Nullable)aSetting
  244. error:(EMError **_Nullable)pError;
  245. /**
  246. * \~chinese
  247. * 创建群组。
  248. *
  249. * 异步方法。
  250. *
  251. * @param aSubject 群组名称。
  252. * @param aDescription 群组描述。
  253. * @param aInvitees 群组成员,不包括创建者自己。
  254. * @param aMessage 加入群组的邀请消息。
  255. * @param aSetting 群组属性。
  256. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  257. *
  258. *
  259. * \~english
  260. * Creates a group.
  261. *
  262. * This is an asynchronous method.
  263. *
  264. * @param aSubject The subject of the group.
  265. * @param aDescription The description of the group.
  266. * @param aInvitees The members of the group. Do not include the creator.
  267. * @param aMessage The invitation message.
  268. * @param aSetting The group options.
  269. * @param aCompletionBlock The completion block, which contains the error message if the method fails.
  270. *
  271. */
  272. - (void)createGroupWithSubject:(NSString *_Nullable)aSubject
  273. description:(NSString *_Nullable)aDescription
  274. invitees:(NSArray<NSString *> * _Nullable)aInvitees
  275. message:(NSString *_Nullable)aMessage
  276. setting:(EMGroupOptions *_Nullable)aSetting
  277. completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
  278. #pragma mark - Fetch Info
  279. /**
  280. * \~chinese
  281. * 获取群组详情,包含群组 ID, 群组名称,群组描述,群组基本属性,群主,群组管理员。
  282. *
  283. * 同步方法,会阻塞当前线程。
  284. *
  285. * @param aGroupId 群组 ID。
  286. * @param pError 错误信息。
  287. *
  288. * @result 群组实例。
  289. *
  290. * \~english
  291. * Fetches the group information,including the group ID, name, description,setting, owner and admins.
  292. *
  293. * This is a synchronous method and blocks the current thread.
  294. *
  295. * @param aGroupId The group ID.
  296. * @param pError The error information if the method fails: Error.
  297. *
  298. * @result The group instance.
  299. */
  300. - (EMGroup * _Nullable)getGroupSpecificationFromServerWithId:(NSString *_Nonnull)aGroupId
  301. error:(EMError **_Nullable)pError;
  302. /**
  303. * \~chinese
  304. * 获取群组详情,包含群组 ID,群组名称,群组描述,群组基本属性,群主,群组管理员。
  305. *
  306. * 同步方法,会阻塞当前线程。
  307. *
  308. * @param aGroupId 群组 ID。
  309. * @param fetchMembers 是否获取群组成员,默认最多取 200 人。
  310. * @param pError 错误信息。
  311. *
  312. * @result 群组实例。
  313. *
  314. * \~english
  315. * Fetches the group specification, including the group ID, name, description, setting, owner, admins.
  316. *
  317. * This is a synchronous method and blocks the current thread.
  318. *
  319. * @param aGroupId The group ID.
  320. * @param fetchMembers Whether to fetch the group members. The default action fetches at most 200 members.
  321. * @param pError The error information if the method fails: Error.
  322. *
  323. * @result The group instance.
  324. */
  325. - (EMGroup * _Nullable)getGroupSpecificationFromServerWithId:(NSString *_Nonnull)aGroupId
  326. fetchMembers:(BOOL)fetchMembers
  327. error:(EMError **_Nullable)pError;
  328. /**
  329. * \~chinese
  330. * 获取群组详情,包含群组 ID,群组名称,群组描述,群组基本属性,群主,群组管理员。
  331. *
  332. * 异步方法。
  333. *
  334. * @param aGroupId 群组 ID。
  335. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  336. *
  337. *
  338. * \~english
  339. * Fetches the group specification, including: ID, name, description, setting, owner, admins.
  340. *
  341. * This is an asynchronous method.
  342. *
  343. * @param aGroupId The group ID.
  344. * @param aCompletionBlock The completion block, which contains the error message if the method fails.
  345. *
  346. */
  347. - (void)getGroupSpecificationFromServerWithId:(NSString *_Nonnull)aGroupId
  348. completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
  349. /**
  350. * \~chinese
  351. * 获取群组详情,包含群组 ID,群组名称,群组描述,群组基本属性,群主,群组管理员。
  352. *
  353. * 异步方法。
  354. *
  355. * @param aGroupId 群组 ID。
  356. * @param fetchMembers 是否获取群组成员,默认最多取 200 人数。
  357. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  358. *
  359. *
  360. * \~english
  361. * Fetches the group specification, including: ID, name, description, setting, owner, admins.
  362. *
  363. * @param aGroupId The group ID.
  364. * @param fetchMembers Whether to fetch the group members. The default action fetches at most 200 members.
  365. * @param aCompletionBlock The completion block, which contains the error message if the method fails.
  366. *
  367. */
  368. - (void)getGroupSpecificationFromServerWithId:(NSString *_Nonnull)aGroupId
  369. fetchMembers:(BOOL)fetchMembers
  370. completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
  371. /**
  372. * \~chinese
  373. * 获取群组成员列表。
  374. *
  375. * 这里需要注意的是:
  376. * - 每次调用只返回一页的数据。首次调用传空值,会从最新的第一条开始取;
  377. * - aPageSize 是这次接口调用期望返回的列表数据个数,如当前在最后一页,返回的数据会是 count < aPageSize;
  378. * - 列表页码 aPageNum 是方便服务器分页查询返回,对于数据量未知且很大的情况,分页获取,服务器会根据每次的页数和每次的pagesize 返回数据,直到返回所有数据。
  379. *
  380. * 同步方法,会阻塞当前线程。
  381. *
  382. * @param aGroupId 群组 ID。
  383. * @param aCursor 游标,首次调用传空。使用场景:第一次传 nil ,然后根据服务器返回的数据,其中有一个字段是 aCursor,保存本地,下次调用接口时,会把更新的aCursor 传入作为获取数据的标志位置。
  384. * @param aPageSize 调用接口时,指定期望返回的列表数据个数。
  385. * @param pError 错误信息。
  386. *
  387. * @result 列表和游标。
  388. *
  389. * \~english
  390. * Gets the list of group members from the server.
  391. *
  392. * This is a synchronous method and blocks the current thread.
  393. *
  394. * @param aGroupId The group ID.
  395. * @param aCursor The cursor when joins the group. Sets the parameter as nil for the first time.
  396. * @param aPageSize The expect entry number of the list.
  397. * @param pError The error information if the method fails: Error.
  398. *
  399. * @result The list and cursor.
  400. *
  401. */
  402. - (EMCursorResult<NSString*> *)getGroupMemberListFromServerWithId:(NSString *_Nonnull)aGroupId
  403. cursor:(NSString *_Nullable)aCursor
  404. pageSize:(NSInteger)aPageSize
  405. error:(EMError **_Nullable)pError;
  406. /**
  407. * \~chinese
  408. * 获取群组成员列表。
  409. * 这里需要注意的是:
  410. * - 每次调用只返回一页的数据。首次调用传空值,会从最新的第一条开始取;
  411. * - aPageSize 是这次接口调用期望返回的列表数据个数,如当前在最后一页,返回的数据会是 count < aPageSize;
  412. * - 列表页码 aPageNum 是方便服务器分页查询返回,对于数据量未知且很大的情况,分页获取,服务器会根据每次的页数和每次的pagesize 返回数据,直到返回所有数据。
  413. *
  414. * @param aGroupId 群组 ID。
  415. * @param aCursor 游标,首次调用传空。
  416. * @param aPageSize 获取多少条。
  417. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  418. *
  419. *
  420. * \~english
  421. * Gets the list of group members from the server.
  422. *
  423. * @param aGroupId The group ID.
  424. * @param aCursor The cursor when joins the group. Sets the parameter as nil for the first time.
  425. * @param aPageSize The page size.
  426. * @param aCompletionBlock The completion block, which contains the error message if the method fails.
  427. *
  428. */
  429. - (void)getGroupMemberListFromServerWithId:(NSString *_Nonnull)aGroupId
  430. cursor:(NSString *_Nullable)aCursor
  431. pageSize:(NSInteger)aPageSize
  432. completion:(void (^_Nullable)(EMCursorResult<NSString*> *aResult, EMError *_Nullable aError))aCompletionBlock;
  433. /**
  434. * \~chinese
  435. * 获取群组黑名单列表。
  436. * 这里需要注意的是:
  437. * - 每次调用只返回一页的数据。首次调用传空值,会从最新的第一条开始取;
  438. * - aPageSize 是这次接口调用期望返回的列表数据个数,如当前在最后一页,返回的数据会是 count < aPageSize;
  439. * - 列表页码 aPageNum 是方便服务器分页查询返回,对于数据量未知且很大的情况,分页获取,服务器会根据每次的页数和每次的pagesize 返回数据,直到返回所有数据。
  440. *
  441. * 该方法只有群主和管理员才有权限调用。
  442. *
  443. * @param aGroupId 群组 ID。
  444. * @param aPageNum 获取第几页。
  445. * @param aPageSize 获取多少条。
  446. * @param pError 错误信息。
  447. *
  448. * @result 黑名单列表。
  449. * \~english
  450. * Gets the blocklist of group from the server.
  451. *
  452. * Only the group owner or admin can call this method.
  453. *
  454. * @param aGroupId The group ID.
  455. * @param aPageNum The page number.
  456. * @param aPageSize The page size.
  457. * @param pError The error information if the method fails: Error.
  458. *
  459. * @result The blockList of the group.
  460. */
  461. - (NSArray<NSString *> * _Nullable)getGroupBlacklistFromServerWithId:(NSString *_Nonnull)aGroupId
  462. pageNumber:(NSInteger)aPageNum
  463. pageSize:(NSInteger)aPageSize
  464. error:(EMError **_Nullable)pError;
  465. /**
  466. * \~chinese
  467. * 获取群组黑名单列表。
  468. *
  469. * 该方法只有群主和管理员才有权限调用。
  470. *
  471. * @param aGroupId 群组 ID。
  472. * @param aPageNum 获取第几页。
  473. * @param aPageSize 获取多少条。
  474. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  475. *
  476. *
  477. * \~english
  478. * Gets the group's blocklist.
  479. *
  480. * Only the group owner or admin can call this method.
  481. *
  482. * @param aGroupId The group ID.
  483. * @param aPageNum The page number.
  484. * @param aPageSize The page size.
  485. * @param aCompletionBlock The completion block, which contains the error message if the method fails.
  486. *
  487. */
  488. - (void)getGroupBlacklistFromServerWithId:(NSString *_Nonnull)aGroupId
  489. pageNumber:(NSInteger)aPageNum
  490. pageSize:(NSInteger)aPageSize
  491. completion:(void (^_Nullable)(NSArray<NSString *> * _Nullable aList, EMError *_Nullable aError))aCompletionBlock;
  492. /**
  493. * \~chinese
  494. * 获取群组被禁言列表。
  495. *
  496. * 该方法只有群主和群管理员允许调用。
  497. *
  498. * @param aGroupId 群组 ID。
  499. * @param aPageNum 获取第几页。
  500. * @param aPageSize 获取多少条。
  501. * @param pError 错误信息。
  502. *
  503. * @result 群组被禁言列表。
  504. *
  505. *
  506. * \~english
  507. * Gets the mutelist of the group from the server.
  508. *
  509. * Only the group owner or admin can call this method.
  510. *
  511. * @param aGroupId The group ID.
  512. * @param aPageNum The page number.
  513. * @param aPageSize The page size.
  514. * @param pError The error information if the method fails: Error.
  515. *
  516. * @result The mutelist of the group.
  517. */
  518. - (NSArray<NSString *> * _Nullable)getGroupMuteListFromServerWithId:(NSString *_Nonnull)aGroupId
  519. pageNumber:(NSInteger)aPageNum
  520. pageSize:(NSInteger)aPageSize
  521. error:(EMError **_Nullable)pError;
  522. /**
  523. * \~chinese
  524. * 获取群组被禁言列表。
  525. *
  526. * 该方法只有群主和群管理员允许调用。
  527. *
  528. * @param aGroupId 群组 ID。
  529. * @param aPageNum 获取第几页。
  530. * @param aPageSize 获取多少条。
  531. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  532. *
  533. *
  534. * \~english
  535. * Gets the mutelist of the group from the server.
  536. *
  537. * Only the group owner or admin can call this method.
  538. *
  539. * @param aGroupId The group ID.
  540. * @param aPageNum The page number.
  541. * @param aPageSize The page size.
  542. * @param aCompletionBlock The completion block, which contains the error message if the method fails.
  543. *
  544. */
  545. - (void)getGroupMuteListFromServerWithId:(NSString *_Nonnull)aGroupId
  546. pageNumber:(NSInteger)aPageNum
  547. pageSize:(NSInteger)aPageSize
  548. completion:(void (^_Nullable)(NSArray<NSString *> * _Nullable aList, EMError *_Nullable aError))aCompletionBlock;
  549. /**
  550. * \~chinese
  551. * 获取群组被禁言列表。
  552. *
  553. * 该方法只有群主和群管理员允许调用。
  554. *
  555. * @param aGroupId 群组 ID。
  556. * @param aPageNum 获取第几页。
  557. * @param aPageSize 获取多少条。
  558. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  559. *
  560. *
  561. * \~english
  562. * Gets the mutelist of the group from the server.
  563. *
  564. * Only the group owner or admin can call this method.
  565. *
  566. * @param aGroupId The group ID.
  567. * @param aPageNum The page number.
  568. * @param aPageSize The page size.
  569. * @param aCompletionBlock The completion block, which contains the error message if the method fails.
  570. *
  571. */
  572. - (void)fetchGroupMuteListFromServerWithId:(NSString *_Nonnull)aGroupId
  573. pageNumber:(NSInteger)aPageNum
  574. pageSize:(NSInteger)aPageSize
  575. completion:(void (^_Nullable)(NSDictionary<NSString *, NSNumber *> *_Nullable aDict, EMError *_Nullable aError))aCompletionBlock;
  576. /**
  577. * \~chinese
  578. * 获取群共享文件列表。
  579. *
  580. * @param aGroupId 群组 ID。
  581. * @param aPageNum 获取第几页。
  582. * @param aPageSize 获取多少条。
  583. * @param pError 错误信息。
  584. *
  585. * @result 群共享文件列表。
  586. *
  587. * \~english
  588. * Gets the share files of group from the server.
  589. *
  590. * @param aGroupId The group ID.
  591. * @param aPageNum The page number.
  592. * @param aPageSize The page size.
  593. * @param pError The error information if the method fails: Error.
  594. *
  595. * @result The list of share files of group.
  596. */
  597. - (NSArray<EMGroupSharedFile *> *_Nullable)getGroupFileListWithId:(NSString *_Nonnull)aGroupId
  598. pageNumber:(NSInteger)aPageNum
  599. pageSize:(NSInteger)aPageSize
  600. error:(EMError **_Nullable)pError;
  601. /**
  602. * \~chinese
  603. * 获取群共享文件列表。
  604. *
  605. * 异步方法。
  606. *
  607. * @param aGroupId 群组 ID。
  608. * @param aPageNum 获取第几页。
  609. * @param aPageSize 获取多少条。
  610. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  611. *
  612. * \~english
  613. * Gets the share files of group from the server.
  614. *
  615. * This is an asynchronous method.
  616. *
  617. * @param aGroupId The group ID.
  618. * @param aPageNum The page number.
  619. * @param aPageSize The page size.
  620. * @param aCompletionBlock The completion block, which contains the error message if the method fails.
  621. */
  622. - (void)getGroupFileListWithId:(NSString *_Nonnull)aGroupId
  623. pageNumber:(NSInteger)aPageNum
  624. pageSize:(NSInteger)aPageSize
  625. completion:(void (^_Nullable)(NSArray<EMGroupSharedFile *> *_Nullable aList, EMError *_Nullable aError))aCompletionBlock;
  626. /**
  627. * \~chinese
  628. * 获取群组白名单列表。
  629. *
  630. * @param aGroupId 群组 ID。
  631. * @param pError 错误信息。
  632. *
  633. * @result 群组白名单列表。
  634. *
  635. *
  636. * \~english
  637. * Gets the allowlist of group from the server.
  638. *
  639. * @param aGroupId The group ID.
  640. * @param pError The error information if the method fails: Error.
  641. *
  642. * @result The allowList of the group.
  643. *
  644. */
  645. - (NSArray *)getGroupWhiteListFromServerWithId:(NSString *_Nonnull)aGroupId
  646. error:(EMError **_Nullable)pError;
  647. /**
  648. * \~chinese
  649. * 获取群组白名单列表。
  650. *
  651. * @param aGroupId 群组 ID。
  652. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  653. *
  654. *
  655. * \~english
  656. * Gets the allowlist of group from the server.
  657. *
  658. * @param aGroupId The group ID.
  659. * @param aCompletionBlock The completion block, which contains the error message if the method fails.
  660. *
  661. */
  662. - (void)getGroupWhiteListFromServerWithId:(NSString *_Nonnull)aGroupId
  663. completion:(void (^_Nullable)(NSArray<NSString *> * _Nullable aList, EMError *_Nullable aError))aCompletionBlock;
  664. /**
  665. * \~chinese
  666. * 查看自己是否在群组白名单中。
  667. *
  668. * @param aGroupId 群组 ID。
  669. * @param pError 错误信息。
  670. *
  671. * @result 布尔值。 YES: 在白名单; NO: 不在白名单。
  672. *
  673. *
  674. * \~english
  675. * Gets whether the member is on the allowlist.
  676. *
  677. * @param aGroupId The group ID.
  678. * @param pError The error information if the method fails: Error.
  679. *
  680. * @result BOOL. YES: in whiteList. NO: not in whiteList.
  681. *
  682. */
  683. - (BOOL)isMemberInWhiteListFromServerWithGroupId:(NSString *_Nonnull)aGroupId
  684. error:(EMError **_Nullable)pError;
  685. /**
  686. * \~chinese
  687. * 查看自己是否在群组白名单中。
  688. *
  689. * @param aGroupId 群组 ID。
  690. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  691. *
  692. *
  693. * \~english
  694. * Gets whether the member is on the allowlist.
  695. *
  696. * @param aGroupId The group ID.
  697. * @param aCompletionBlock The completion block, which contains the error message if the method fails.
  698. *
  699. */
  700. - (void)isMemberInWhiteListFromServerWithGroupId:(NSString *_Nonnull)aGroupId
  701. completion:(void (^_Nullable)(BOOL inWhiteList, EMError *_Nullable aError))aCompletionBlock;
  702. /**
  703. * \~chinese
  704. * 获取群公告。
  705. *
  706. * @param aGroupId 群组 ID。
  707. * @param pError 错误信息。
  708. *
  709. * @result 群公告。失败返回空值。
  710. *
  711. * \~english
  712. * Gets the announcement of group from the server.
  713. *
  714. * @param aGroupId The group ID.
  715. * @param pError The error information if the method fails: Error.
  716. *
  717. * @result The group Announcement. The SDK will return nil if fails.
  718. */
  719. - (NSString *_Nullable)getGroupAnnouncementWithId:(NSString *_Nonnull)aGroupId
  720. error:(EMError **_Nullable)pError;
  721. /**
  722. * \~chinese
  723. * 获取群公告。
  724. *
  725. * @param aGroupId 群组 ID。
  726. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  727. *
  728. *
  729. * \~english
  730. * Gets the announcement of group from the server.
  731. *
  732. * @param aGroupId The group ID.
  733. * @param aCompletionBlock The completion block, which contains the error message if the method fails.
  734. *
  735. */
  736. - (void)getGroupAnnouncementWithId:(NSString *_Nonnull)aGroupId
  737. completion:(void (^_Nullable)(NSString *aAnnouncement, EMError *_Nullable aError))aCompletionBlock;
  738. #pragma mark - Edit Group
  739. /**
  740. * \~chinese
  741. * 邀请用户加入群组。
  742. *
  743. * 同步方法,会阻塞当前线程。
  744. *
  745. * @param aOccupants 被邀请的用户名列表。
  746. * @param aGroupId 群组 ID。
  747. * @param aWelcomeMessage 欢迎信息。
  748. * @param pError 错误信息。
  749. *
  750. * @result 群组实例。失败返回空值。
  751. *
  752. * \~english
  753. * Invites users to join a group.
  754. *
  755. * This is a synchronous method and blocks the current thread.
  756. *
  757. * @param aOccupants The users who are invited.
  758. * @param aGroupId The group ID.
  759. * @param aWelcomeMessage The welcome message.
  760. * @param pError The error information if the method fails: Error.
  761. *
  762. * @result The group instance. The SDK will return nil if fails.
  763. */
  764. - (EMGroup * _Nullable)addOccupants:(NSArray<NSString *> * _Nonnull)aOccupants
  765. toGroup:(NSString *_Nonnull)aGroupId
  766. welcomeMessage:(NSString *_Nullable)aWelcomeMessage
  767. error:(EMError **_Nullable)pError;
  768. /**
  769. * \~chinese
  770. * 邀请用户加入群组。
  771. *
  772. * @param aUsers 被邀请的用户名列表。
  773. * @param aGroupId 群组 ID。
  774. * @param aMessage 欢迎信息。
  775. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  776. *
  777. *
  778. * \~english
  779. * Invites users to join a group.
  780. *
  781. * @param aUsers The users who are invited to join the group.
  782. * @param aGroupId The group ID.
  783. * @param aMessage The welcome message.
  784. * @param aCompletionBlock The completion block, which contains the error message if the method fails.
  785. *
  786. */
  787. - (void)addMembers:(NSArray<NSString *> * _Nonnull)aUsers
  788. toGroup:(NSString *_Nonnull)aGroupId
  789. message:(NSString *_Nullable)aMessage
  790. completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
  791. /**
  792. * \~chinese
  793. * 将群成员移出群组。
  794. *
  795. * 该方法只有群主才有权限调用。
  796. *
  797. * 同步方法,会阻塞当前线程。
  798. *
  799. * @param aOccupants 要移出群组的用户列表。
  800. * @param aGroupId 群组 ID。
  801. * @param pError 错误信息。
  802. *
  803. * @result 群组实例。
  804. *
  805. * \~english
  806. * Removes members from the group.
  807. *
  808. * Only the group owner can call this method.
  809. *
  810. * This is a synchronous method and blocks the current thread.
  811. *
  812. * @param aOccupants The users to be removed from the group.
  813. * @param aGroupId The group ID.
  814. * @param pError The error information if the method fails: Error.
  815. *
  816. * @result The group instance.
  817. */
  818. - (EMGroup * _Nullable)removeOccupants:(NSArray<NSString *> * _Nonnull)aOccupants
  819. fromGroup:(NSString *_Nonnull)aGroupId
  820. error:(EMError **_Nullable)pError;
  821. /**
  822. * \~chinese
  823. * 将群成员移出群组。
  824. *
  825. * 该方法只有群主才有权限调用。
  826. *
  827. * @param aUsers 要移出群组的用户列表。
  828. * @param aGroupId 群组 ID。
  829. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  830. *
  831. *
  832. * \~english
  833. * Removes members from the group.
  834. *
  835. * Only the group owner can call this method.
  836. *
  837. * @param aUsers The members to be removed from the group.
  838. * @param aGroupId The group ID.
  839. * @param aCompletionBlock The completion block, which contains the error message if the method fails.
  840. *
  841. */
  842. - (void)removeMembers:(NSArray<NSString *> * _Nonnull)aUsers
  843. fromGroup:(NSString *_Nonnull)aGroupId
  844. completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
  845. /**
  846. * \~chinese
  847. * 加人到群组黑名单。
  848. *
  849. * 该方法只有群主才有权限调用。
  850. *
  851. * 同步方法,会阻塞当前线程。
  852. *
  853. * @param aOccupants 要加入黑名单的用户。
  854. * @param aGroupId 群组 ID。
  855. * @param pError 错误信息。
  856. *
  857. * @result 群组实例。
  858. *
  859. * \~english
  860. * Adds users to blocklist of the group.
  861. *
  862. * Only the group owner can call this method.
  863. *
  864. * This is a synchronous method and blocks the current thread.
  865. *
  866. * @param aOccupants The users to be added to the blockList.
  867. * @param aGroupId The group ID.
  868. * @param pError The error information if the method fails: Error.
  869. *
  870. * @result The group instance.
  871. */
  872. - (EMGroup * _Nullable)blockOccupants:(NSArray<NSString *> * _Nonnull)aOccupants
  873. fromGroup:(NSString *_Nonnull)aGroupId
  874. error:(EMError **_Nullable)pError;
  875. /**
  876. * \~chinese
  877. * 加人到群组黑名单。
  878. *
  879. * 该方法只有群主才有权限调用。
  880. *
  881. * @param aMembers 要加入黑名单的用户。
  882. * @param aGroupId 群组 ID。
  883. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  884. *
  885. *
  886. * \~english
  887. * Adds users to blocklist of the group.
  888. *
  889. * Only the group owner can call this method.
  890. *
  891. * @param aMembers The users to be added to the blockList.
  892. * @param aGroupId The group ID.
  893. * @param aCompletionBlock The completion block, which contains the error message if the method fails.
  894. *
  895. */
  896. - (void)blockMembers:(NSArray<NSString *> * _Nonnull)aMembers
  897. fromGroup:(NSString *_Nonnull)aGroupId
  898. completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
  899. /**
  900. * \~chinese
  901. * 从群组黑名单中移除。
  902. *
  903. * 该方法只有群主才有权限调用。
  904. *
  905. * 同步方法,会阻塞当前线程。
  906. *
  907. * @param aOccupants 要从黑名单中移除的用户名列表。
  908. * @param aGroupId 群组 ID。
  909. * @param pError 错误信息。
  910. *
  911. * @result 群组实例。
  912. *
  913. * \~english
  914. * Removes users from the blocklist of the group.
  915. *
  916. * Only the group owner can call this method.
  917. *
  918. * This is a synchronous method and blocks the current thread.
  919. *
  920. * @param aOccupants The users to be removed from the blockList.
  921. * @param aGroupId The group ID.
  922. * @param pError The error information if the method fails: Error.
  923. *
  924. * @result The group instance.
  925. */
  926. - (EMGroup * _Nullable)unblockOccupants:(NSArray<NSString *> * _Nonnull)aOccupants
  927. forGroup:(NSString *_Nonnull)aGroupId
  928. error:(EMError **_Nullable)pError;
  929. /**
  930. * \~chinese
  931. * 从群组黑名单中移除。
  932. *
  933. * 该方法只有群主才有权限调用。
  934. *
  935. * @param aMembers 要从黑名单中移除的用户名列表。
  936. * @param aGroupId 群组 ID。
  937. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  938. *
  939. *
  940. * \~english
  941. * Removes users out of the blocklist of the group.
  942. *
  943. * Only the group owner can call this method.
  944. *
  945. * @param aMembers The users to be removed from the blockList.
  946. * @param aGroupId The group ID.
  947. * @param aCompletionBlock The completion block, which contains the error message if the method fails.
  948. *
  949. */
  950. - (void)unblockMembers:(NSArray<NSString *> * _Nonnull)aMembers
  951. fromGroup:(NSString *_Nonnull)aGroupId
  952. completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
  953. /**
  954. * \~chinese
  955. * 更改群组主题。
  956. *
  957. * 该方法只有群主才有权限调用。
  958. *
  959. * 同步方法,会阻塞当前线程。
  960. *
  961. * @param aSubject 新主题。
  962. * @param aGroupId 群组 ID。
  963. * @param pError 错误信息。
  964. *
  965. * @result 群组实例。
  966. *
  967. * \~english
  968. * Changes the subject of the group.
  969. *
  970. * Only the group owner can call this method.
  971. *
  972. * This is a synchronous method and blocks the current thread.
  973. *
  974. * @param aSubject The new subject of the group.
  975. * @param aGroupId The group ID.
  976. * @param pError The error information if the method fails: Error.
  977. *
  978. * @result The group instance.
  979. */
  980. - (EMGroup * _Nullable)changeGroupSubject:(NSString *_Nullable)aSubject
  981. forGroup:(NSString *_Nonnull)aGroupId
  982. error:(EMError **_Nullable)pError;
  983. /**
  984. * \~chinese
  985. * 更改群组主题 。
  986. *
  987. * 该方法只有群主才有权限调用。
  988. *
  989. * @param aSubject 新主题。
  990. * @param aGroupId 群组 ID。
  991. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  992. *
  993. *
  994. * \~english
  995. * Changes the group subject.
  996. *
  997. * Only the group owner can call this method.
  998. *
  999. * @param aSubject The new subject of the group.
  1000. * @param aGroupId The group ID.
  1001. * @param aCompletionBlock The completion block, which contains the error message if the method fails.
  1002. *
  1003. */
  1004. - (void)updateGroupSubject:(NSString *_Nullable)aSubject
  1005. forGroup:(NSString *_Nonnull)aGroupId
  1006. completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
  1007. /**
  1008. * \~chinese
  1009. * 更改群组说明信息。
  1010. *
  1011. * 该方法只有群主才有权限调用。
  1012. *
  1013. * 同步方法,会阻塞当前线程。
  1014. *
  1015. * @param aDescription 说明信息。
  1016. * @param aGroupId 群组 ID。
  1017. * @param pError 错误信息。
  1018. *
  1019. * @result 群组实例。
  1020. *
  1021. * \~english
  1022. * Changes the group description.
  1023. *
  1024. * Only the group owner can call this method.
  1025. *
  1026. * This is a synchronous method and blocks the current thread.
  1027. *
  1028. * @param aDescription The new group description.
  1029. * @param aGroupId The group ID.
  1030. * @param pError The error information if the method fails: Error.
  1031. *
  1032. * @result The group instance.
  1033. */
  1034. - (EMGroup * _Nullable)changeDescription:(NSString *_Nullable)aDescription
  1035. forGroup:(NSString *_Nonnull)aGroupId
  1036. error:(EMError **_Nullable)pError;
  1037. /**
  1038. * \~chinese
  1039. * 更改群组说明信息。
  1040. *
  1041. * 该方法只有群主才有权限调用。
  1042. *
  1043. * @param aDescription 说明信息。
  1044. * @param aGroupId 群组 ID。
  1045. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  1046. *
  1047. *
  1048. * \~english
  1049. * Changes the group description.
  1050. *
  1051. * Only the group owner can call this method.
  1052. *
  1053. * @param aDescription The new group‘s description.
  1054. * @param aGroupId The group ID.
  1055. * @param aCompletionBlock The completion block, which contains the error message if the method fails.
  1056. *
  1057. */
  1058. - (void)updateDescription:(NSString *_Nullable)aDescription
  1059. forGroup:(NSString *_Nonnull)aGroupId
  1060. completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
  1061. /**
  1062. * \~chinese
  1063. * 退出群组,群主不能退出群,只能销毁群。
  1064. *
  1065. * 同步方法,会阻塞当前线程。
  1066. *
  1067. * @param aGroupId 群组 ID。
  1068. * @param pError 错误信息。
  1069. *
  1070. *
  1071. * \~english
  1072. * Leaves a group. The owner can't leave the group, can only destroy the group.
  1073. *
  1074. * This is a synchronous method and blocks the current thread.
  1075. *
  1076. * @param aGroupId The group ID.
  1077. * @param pError The error information if the method fails: Error.
  1078. *
  1079. */
  1080. - (void)leaveGroup:(NSString *_Nonnull)aGroupId
  1081. error:(EMError **_Nullable)pError;
  1082. /**
  1083. * \~chinese
  1084. * 退出群组,群主不能退出群,只能销毁群。
  1085. *
  1086. * @param aGroupId 群组 ID。
  1087. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  1088. *
  1089. *
  1090. * \~english
  1091. * Leaves a group. The owner can't leave the group, can only destroy the group.
  1092. *
  1093. * @param aGroupId The group ID.
  1094. * @param aCompletionBlock The completion block, which contains the error message if the method fails.
  1095. *
  1096. */
  1097. - (void)leaveGroup:(NSString *_Nonnull)aGroupId
  1098. completion:(void (^_Nullable)(EMError *_Nullable aError))aCompletionBlock;
  1099. /**
  1100. * \~chinese
  1101. * 解散群组。
  1102. *
  1103. * 该方法只有群主才有权限调用。
  1104. *
  1105. * 同步方法,会阻塞当前线程。
  1106. *
  1107. * @param aGroupId 群组 ID。
  1108. *
  1109. * @result EMError 错误信息。成功返回 nil。
  1110. *
  1111. * \~english
  1112. * Destroys a group.
  1113. *
  1114. * Only the group owner can call this method.
  1115. *
  1116. * This is a synchronous method and blocks the current thread.
  1117. *
  1118. * @param aGroupId The group ID.
  1119. *
  1120. * @result The error information if the method fails: Error. The SDK wil return nil if the method succeed.
  1121. */
  1122. - (EMError *)destroyGroup:(NSString *_Nonnull)aGroupId;
  1123. /**
  1124. * \~chinese
  1125. * 解散群组。
  1126. *
  1127. * 该方法只有群主才有权限调用。
  1128. *
  1129. * @param aGroupId 群组 ID。
  1130. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  1131. *
  1132. * \~english
  1133. * Destroys a group.
  1134. *
  1135. * Only the group owner can call this method.
  1136. *
  1137. * @param aGroupId The group ID.
  1138. * @param aCompletionBlock The completion block, which contains the error message if the method fails.
  1139. *
  1140. */
  1141. - (void)destroyGroup:(NSString *_Nonnull)aGroupId
  1142. finishCompletion:(void (^_Nullable)(EMError *_Nullable aError))aCompletionBlock;
  1143. /**
  1144. * \~chinese
  1145. * 屏蔽群消息,服务器不再发送此群的消息给用户,群主不能屏蔽群消息。
  1146. *
  1147. * 同步方法,会阻塞当前线程。
  1148. *
  1149. * @param aGroupId 要屏蔽的群 ID。
  1150. * @param pError 错误信息。
  1151. *
  1152. * @result 群组实例。
  1153. *
  1154. * \~english
  1155. * Blocks group messages. The server will block the messages from the group.
  1156. *
  1157. * The group owner can't block the group's messages.
  1158. *
  1159. * This is a synchronous method and blocks the current thread.
  1160. *
  1161. * @param aGroupId The group ID.
  1162. * @param pError The error information if the method fails: Error.
  1163. *
  1164. * @result The group instance.
  1165. */
  1166. - (EMGroup * _Nullable)blockGroup:(NSString *_Nonnull)aGroupId
  1167. error:(EMError **_Nullable)pError;
  1168. /**
  1169. * \~chinese
  1170. * 屏蔽群消息,服务器不再发送此群的消息给用户,群主不能屏蔽群消息。
  1171. *
  1172. * @param aGroupId 要屏蔽的群组 ID。
  1173. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  1174. *
  1175. * \~english
  1176. * Blocks group messages, so the server blocks the messages from the group.
  1177. *
  1178. * The group owner can't block the group's messages.
  1179. *
  1180. * @param aGroupId The group ID.
  1181. * @param aCompletionBlock The completion block, which contains the error message if the method fails.
  1182. *
  1183. */
  1184. - (void)blockGroup:(NSString *_Nonnull)aGroupId
  1185. completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
  1186. /**
  1187. * \~chinese
  1188. * 取消屏蔽群消息
  1189. *
  1190. * 同步方法,会阻塞当前线程。
  1191. *
  1192. * @param aGroupId 要取消屏蔽的群组 ID。
  1193. * @param pError 错误信息。
  1194. *
  1195. * @result 群组实例。
  1196. *
  1197. * \~english
  1198. * Unblocks group messages.
  1199. *
  1200. * This is a synchronous method and blocks the current thread.
  1201. *
  1202. * @param aGroupId The group ID.
  1203. * @param pError The error information if the method fails: Error.
  1204. *
  1205. * @result The group instance.
  1206. */
  1207. - (EMGroup * _Nullable)unblockGroup:(NSString *_Nonnull)aGroupId
  1208. error:(EMError **_Nullable)pError;
  1209. /**
  1210. * \~chinese
  1211. * 取消屏蔽群消息。
  1212. *
  1213. * @param aGroupId 要取消屏蔽的群组 ID。
  1214. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  1215. *
  1216. * \~english
  1217. * Unblocks group messages.
  1218. *
  1219. * @param aGroupId The group ID.
  1220. * @param aCompletionBlock The completion block, which contains the error message if the method fails.
  1221. *
  1222. */
  1223. - (void)unblockGroup:(NSString *_Nonnull)aGroupId
  1224. completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
  1225. /**
  1226. * \~chinese
  1227. * 改变群主。
  1228. *
  1229. * 该方法只有群主才有权限调用。
  1230. *
  1231. * 同步方法,会阻塞当前线程。
  1232. *
  1233. * @param aGroupId 群组 ID。
  1234. * @param aNewOwner 新群主。
  1235. * @param pError 错误信息。
  1236. *
  1237. * @result 返回群组实例。
  1238. *
  1239. * \~english
  1240. * Changes the owner of the group.
  1241. *
  1242. * Only the group owner can call this method.
  1243. *
  1244. * This is a synchronous method and blocks the current thread.
  1245. *
  1246. * @param aGroupId The group ID.
  1247. * @param aNewOwner The new group owner.
  1248. * @param pError The error information if the method fails: Error.
  1249. *
  1250. * @result The group instance.
  1251. */
  1252. - (EMGroup * _Nullable)updateGroupOwner:(NSString *_Nonnull)aGroupId
  1253. newOwner:(NSString *_Nonnull)aNewOwner
  1254. error:(EMError **_Nullable)pError;
  1255. /**
  1256. * \~chinese
  1257. * 改变群主。
  1258. *
  1259. * 该方法只有群主才有权限调用。
  1260. *
  1261. * @param aGroupId 群组 ID。
  1262. * @param aNewOwner 新群主。
  1263. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  1264. *
  1265. *
  1266. * \~english
  1267. * Changes the owner of the group.
  1268. *
  1269. * Only the group owner can call this method.
  1270. *
  1271. * @param aGroupId The group ID.
  1272. * @param aNewOwner The new group owner.
  1273. * @param aCompletionBlock The completion block, which contains the error message if the method fails.
  1274. *
  1275. */
  1276. - (void)updateGroupOwner:(NSString *_Nonnull)aGroupId
  1277. newOwner:(NSString *_Nonnull)aNewOwner
  1278. completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
  1279. /**
  1280. * \~chinese
  1281. * 添加群组管理员。
  1282. *
  1283. * 该方法只有群主才有权限调用。
  1284. *
  1285. * 同步方法,会阻塞当前线程。
  1286. *
  1287. * @param aAdmin 要添加的群组管理员。
  1288. * @param aGroupId 群组 ID。
  1289. * @param pError 错误信息。
  1290. * @result 返回群组实例。
  1291. *
  1292. * \~english
  1293. * Adds group admin.
  1294. *
  1295. * Only the group owner can call this method.
  1296. *
  1297. * This is a synchronous method and blocks the current thread.
  1298. *
  1299. * @param aAdmin The admin to be added.
  1300. * @param aGroupId The group ID.
  1301. * @param pError The error information if the method fails: Error.
  1302. * @result The group instance.
  1303. */
  1304. - (EMGroup * _Nullable)addAdmin:(NSString *_Nonnull)aAdmin
  1305. toGroup:(NSString *_Nonnull)aGroupId
  1306. error:(EMError **_Nullable)pError;
  1307. /**
  1308. * \~chinese
  1309. * 添加群组管理员。
  1310. *
  1311. * 异步方法。
  1312. *
  1313. * 该方法只有群主才有权限调用。
  1314. *
  1315. * @param aAdmin 要添加的群组管理员。
  1316. * @param aGroupId 群组 ID。
  1317. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  1318. *
  1319. *
  1320. * \~english
  1321. * Adds group admin.
  1322. *
  1323. * This is an asynchronous method.
  1324. *
  1325. * Only the group owner can call this method.
  1326. *
  1327. * @param aAdmin The admin to be added.
  1328. * @param aGroupId The group ID.
  1329. * @param aCompletionBlock The completion block, which contains the error message if the method fails.
  1330. *
  1331. */
  1332. - (void)addAdmin:(NSString *_Nonnull)aAdmin
  1333. toGroup:(NSString *_Nonnull)aGroupId
  1334. completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
  1335. /**
  1336. * \~chinese
  1337. * 移除群组管理员。
  1338. *
  1339. * 该方法只有群主才有权限调用。
  1340. *
  1341. * 同步方法,会阻塞当前线程。
  1342. *
  1343. * @param aAdmin 要移除的群组管理员。
  1344. * @param aGroupId 群组 ID。
  1345. * @param pError 错误信息。
  1346. *
  1347. * @result 返回群组实例。
  1348. *
  1349. * \~english
  1350. * Removes a group admin.
  1351. *
  1352. * Only the group owner can call this method.
  1353. *
  1354. * This is a synchronous method and blocks the current thread.
  1355. *
  1356. * @param aAdmin The admin to be removed.
  1357. * @param aGroupId The group ID.
  1358. * @param pError The error information if the method fails: Error.
  1359. *
  1360. * @result The group instance.
  1361. */
  1362. - (EMGroup * _Nullable)removeAdmin:(NSString *_Nonnull)aAdmin
  1363. fromGroup:(NSString *_Nonnull)aGroupId
  1364. error:(EMError **_Nullable)pError;
  1365. /**
  1366. * \~chinese
  1367. * 移除群组管理员。
  1368. *
  1369. * 该方法只有群主才有权限调用。
  1370. *
  1371. * 异步方法。
  1372. *
  1373. * @param aAdmin 要移除的群组管理员。
  1374. * @param aGroupId 群组 ID。
  1375. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  1376. *
  1377. *
  1378. * \~english
  1379. * Removes the group admin.
  1380. *
  1381. * Only the group owner can call this method.
  1382. *
  1383. * This is an asynchronous method.
  1384. *
  1385. * @param aAdmin The admin to be removed.
  1386. * @param aGroupId The group ID.
  1387. * @param aCompletionBlock The completion block, which contains the error message if the method fails.
  1388. *
  1389. */
  1390. - (void)removeAdmin:(NSString *_Nonnull)aAdmin
  1391. fromGroup:(NSString *_Nonnull)aGroupId
  1392. completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
  1393. /**
  1394. * \~chinese
  1395. * 将一组成员禁言。
  1396. *
  1397. * 该方法只有管理员或者群主才有权限调用。
  1398. *
  1399. * 同步方法,会阻塞当前线程。
  1400. *
  1401. * @param aMuteMembers 要禁言的成员列表。
  1402. * @param aMuteMilliseconds 禁言时长。
  1403. * @param aGroupId 群组 ID。
  1404. * @param pError 错误信息。
  1405. *
  1406. * @result 返回群组实例。
  1407. *
  1408. * \~english
  1409. * Mutes group members.
  1410. *
  1411. * Only the chatroom owner or admin can call this method.
  1412. *
  1413. * This is a synchronous method and blocks the current thread.
  1414. *
  1415. * @param aMuteMembers The list of members to be muted.
  1416. * @param aMuteMilliseconds The muted time duration in millisecond.
  1417. * @param aGroupId The group ID.
  1418. * @param pError The error information if the method fails: Error.
  1419. *
  1420. * @result The group instance.
  1421. */
  1422. - (EMGroup * _Nullable)muteMembers:(NSArray<NSString *> * _Nonnull)aMuteMembers
  1423. muteMilliseconds:(NSInteger)aMuteMilliseconds
  1424. fromGroup:(NSString *_Nonnull)aGroupId
  1425. error:(EMError **_Nullable)pError;
  1426. /**
  1427. * \~chinese
  1428. * 将一组成员禁言。
  1429. *
  1430. * 该方法只有管理员或者群主才有权限调用。
  1431. *
  1432. * 异步方法。
  1433. *
  1434. * @param aMuteMembers 要禁言的成员列表。
  1435. * @param aMuteMilliseconds 禁言时长。
  1436. * @param aGroupId 群组 ID。
  1437. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  1438. *
  1439. * \~english
  1440. * Mutes group members.
  1441. *
  1442. * Only the chatroom owner or admin can call this method.
  1443. *
  1444. * This is an asynchronous method.
  1445. *
  1446. * @param aMuteMembers The list of mute, type is <NSString>
  1447. * @param aMuteMilliseconds Muted time duration in millisecond
  1448. * @param aGroupId The group ID.
  1449. * @param aCompletionBlock The completion block, which contains the error message if the method fails.
  1450. *
  1451. */
  1452. - (void)muteMembers:(NSArray<NSString *> * _Nonnull)aMuteMembers
  1453. muteMilliseconds:(NSInteger)aMuteMilliseconds
  1454. fromGroup:(NSString *_Nonnull)aGroupId
  1455. completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
  1456. /**
  1457. * \~chinese
  1458. * 解除禁言。
  1459. *
  1460. * 该方法只有管理员或者群主才有权限调用。
  1461. *
  1462. * 同步方法,会阻塞当前线程。
  1463. *
  1464. * @param aMuteMembers 被解除禁言的用户列表。
  1465. * @param aGroupId 群组 ID。
  1466. * @param pError 错误信息。
  1467. *
  1468. * @result 返回群组实例。
  1469. *
  1470. * \~english
  1471. * Unmutes group members.
  1472. *
  1473. * Only the chatroom owner or admin can call this method.
  1474. *
  1475. * This is a synchronous method and blocks the current thread.
  1476. *
  1477. * @param aMembers The list of members to be unmuted.
  1478. * @param aGroupId The group ID.
  1479. * @param pError The error information if the method fails: Error.
  1480. *
  1481. * @result The group instance.
  1482. */
  1483. - (EMGroup * _Nullable)unmuteMembers:(NSArray<NSString *> * _Nonnull)aMembers
  1484. fromGroup:(NSString *_Nonnull)aGroupId
  1485. error:(EMError **_Nullable)pError;
  1486. /**
  1487. * \~chinese
  1488. * 解除禁言。
  1489. *
  1490. * 该方法只有管理员或者群主才有权限调用。
  1491. *
  1492. * 异步方法。
  1493. *
  1494. * @param aMuteMembers 被解除禁言的用户列表。
  1495. * @param aGroupId 群组 ID。
  1496. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  1497. *
  1498. * \~english
  1499. * Unmutes group members.
  1500. *
  1501. * Only the chatroom owner or admin can call this method.
  1502. *
  1503. * This is an asynchronous method.
  1504. *
  1505. * @param aMembers The list of members to be unmuted.
  1506. * @param aGroupId The group ID.
  1507. * @param aCompletionBlock The completion block, which contains the error message if the method fails.
  1508. *
  1509. */
  1510. - (void)unmuteMembers:(NSArray<NSString *> * _Nonnull)aMembers
  1511. fromGroup:(NSString *_Nonnull)aGroupId
  1512. completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
  1513. /**
  1514. * \~chinese
  1515. * 设置全员禁言。
  1516. *
  1517. * 该方法只有管理员或者群主才有权限调用。
  1518. *
  1519. * 同步方法,会阻塞当前线程。
  1520. *
  1521. * @param aGroupId 群组 ID。
  1522. * @param pError 错误信息。
  1523. *
  1524. * @result 群组实例。
  1525. *
  1526. * \~english
  1527. * Mutes all members.
  1528. *
  1529. * Only the chatroom owner or admin can call this method.
  1530. *
  1531. * This is a synchronous method and blocks the current thread.
  1532. *
  1533. * @param aGroupId The group ID.
  1534. * @param pError The error information if the method fails: Error.
  1535. *
  1536. * @result The group instance.
  1537. */
  1538. - (EMGroup * _Nullable)muteAllMembersFromGroup:(NSString *_Nonnull)aGroupId
  1539. error:(EMError **_Nullable)pError;
  1540. /**
  1541. * \~chinese
  1542. * 设置全员禁言。
  1543. *
  1544. * 该方法只有管理员或者群主才有权限调用。
  1545. *
  1546. * 异步方法。
  1547. *
  1548. * @param aGroupId 群组 ID。
  1549. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  1550. *
  1551. * \~english
  1552. * mute all members.
  1553. *
  1554. * Only the chatroom owner or admin can call this method.
  1555. *
  1556. * This is an asynchronous method.
  1557. *
  1558. * @param aGroupId The group ID.
  1559. * @param aCompletionBlock The completion block, which contains the error message if the method fails.
  1560. *
  1561. */
  1562. - (void)muteAllMembersFromGroup:(NSString *_Nonnull)aGroupId
  1563. completion:(void(^)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
  1564. /**
  1565. * \~chinese
  1566. * 解除全员禁言。
  1567. *
  1568. * 该方法只有管理员或者群主才有权限调用。
  1569. *
  1570. * 同步方法,会阻塞当前线程。
  1571. *
  1572. * @param aGroupId 群组 ID。
  1573. * @param pError 错误信息。
  1574. *
  1575. * @result 群组实例。
  1576. *
  1577. * \~english
  1578. * Unmutes all members.
  1579. *
  1580. * Only the chatroom owner or admin can call this method.
  1581. *
  1582. * This is a synchronous method and blocks the current thread.
  1583. *
  1584. * @param aGroupId The group ID.
  1585. * @param pError The error information if the method fails: Error.
  1586. *
  1587. * @result The group instance.
  1588. */
  1589. - (EMGroup * _Nullable)unmuteAllMembersFromGroup:(NSString *_Nonnull)aGroupId
  1590. error:(EMError **_Nullable)pError;
  1591. /**
  1592. * \~chinese
  1593. * 解除全员禁言。
  1594. *
  1595. * 该方法只有管理员或者群主才有权限调用。
  1596. *
  1597. * 异步方法。
  1598. *
  1599. * @param aGroupId 群组 ID。
  1600. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  1601. *
  1602. * \~english
  1603. * Unmutes all members.
  1604. *
  1605. * Only the chatroom owner or admin can call this method.
  1606. *
  1607. * This is an asynchronous method.
  1608. *
  1609. * @param aGroupId The group ID.
  1610. * @param aCompletionBlock The completion block, which contains the error message if the method fails.
  1611. *
  1612. */
  1613. - (void)unmuteAllMembersFromGroup:(NSString *_Nonnull)aGroupId
  1614. completion:(void(^)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
  1615. /**
  1616. * \~chinese
  1617. * 添加白名单。
  1618. *
  1619. * 该方法只有管理员或者群主才有权限调用。
  1620. *
  1621. * 同步方法,会阻塞当前线程。
  1622. *
  1623. * @param aMuteMembers 要添加的成员列表。
  1624. * @param aGroupId 群组 ID。
  1625. * @param pError 错误信息。
  1626. *
  1627. * @result 群组实例。
  1628. *
  1629. * \~english
  1630. * Adds members to the allowlist.
  1631. *
  1632. * Only the chatroom owner or admin can call this method.
  1633. *
  1634. * This is a synchronous method and blocks the current thread.
  1635. *
  1636. * @param aMembers The members to be added to the allowlist.
  1637. * @param aGroupId The group ID.
  1638. * @param pError The error information if the method fails: Error.
  1639. *
  1640. * @result The group instance.
  1641. */
  1642. - (EMGroup * _Nullable)addWhiteListMembers:(NSArray<NSString *> * _Nonnull)aMembers
  1643. fromGroup:(NSString *_Nonnull)aGroupId
  1644. error:(EMError **_Nullable)pError;
  1645. /**
  1646. * \~chinese
  1647. * 添加白名单。
  1648. *
  1649. * 该方法只有管理员或者群主才有权限调用。
  1650. *
  1651. * 异步方法。
  1652. *
  1653. * @param aMembers 要添加的成员列表。
  1654. * @param aGroupId 群组 ID。
  1655. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  1656. *
  1657. * \~english
  1658. * Adds members to the allowlist.
  1659. *
  1660. * Only the chatroom owner or admin can call this method.
  1661. *
  1662. * @param aMembers The members to be added to the allowlist.
  1663. * @param aGroupId The group ID.
  1664. * @param aCompletionBlock The completion block, which contains the error message if the method fails.
  1665. *
  1666. */
  1667. - (void)addWhiteListMembers:(NSArray<NSString *> * _Nonnull)aMembers
  1668. fromGroup:(NSString *_Nonnull)aGroupId
  1669. completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
  1670. /**
  1671. * \~chinese
  1672. * 移除白名单。
  1673. *
  1674. * 该方法只有管理员或者群主才有权限调用。
  1675. *
  1676. * 同步方法,会阻塞当前线程。
  1677. *
  1678. * @param aMuteMembers 要添加的成员列表。
  1679. * @param aGroupId 群组 ID。
  1680. * @param pError 错误信息。
  1681. *
  1682. * @result 群组实例。
  1683. *
  1684. * \~english
  1685. * Removes members from the allowlist.
  1686. *
  1687. * Only the chatroom owner or admin can call this method.
  1688. *
  1689. * This is a synchronous method and blocks the current thread.
  1690. *
  1691. * @param aMembers The members to be removed from the allowlist.
  1692. * @param aGroupId The group ID.
  1693. * @param pError The error information if the method fails: Error.
  1694. *
  1695. * @result The group instance.
  1696. */
  1697. - (EMGroup * _Nullable)removeWhiteListMembers:(NSArray<NSString *> * _Nonnull)aMembers
  1698. fromGroup:(NSString *_Nonnull)aGroupId
  1699. error:(EMError **_Nullable)pError;
  1700. /**
  1701. * \~chinese
  1702. * 移除白名单。
  1703. *
  1704. * 异步方法。
  1705. *
  1706. * 该方法只有管理员或者群主才有权限调用。
  1707. *
  1708. * @param aMembers 被移除的列表。
  1709. * @param aGroupId 群组 ID。
  1710. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  1711. *
  1712. * \~english
  1713. * Removes members from the allowlist.
  1714. *
  1715. * This is an asynchronous method.
  1716. *
  1717. * Only the chatroom owner or admin can call this method.
  1718. *
  1719. * @param aMembers The members to be removed from the allowlist.
  1720. * @param aGroupId The group ID.
  1721. * @param aCompletionBlock The completion block, which contains the error message if the method fails.
  1722. *
  1723. */
  1724. - (void)removeWhiteListMembers:(NSArray<NSString *> * _Nonnull)aMembers
  1725. fromGroup:(NSString *_Nonnull)aGroupId
  1726. completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
  1727. /**
  1728. * \~chinese
  1729. * 上传群共享文件。
  1730. *
  1731. * @param aGroupId 群组 ID。
  1732. * @param aFilePath 文件路径。
  1733. * @param pError 错误信息。
  1734. *
  1735. * @result 群组实例。
  1736. *
  1737. * \~english
  1738. * Uploads the share file of group.
  1739. *
  1740. * @param aGroupId The group ID.
  1741. * @param aFilePath The path of file.
  1742. * @param pError The error information if the method fails: Error.
  1743. *
  1744. * @result The group instance.
  1745. */
  1746. - (void)uploadGroupSharedFileWithId:(NSString *_Nonnull)aGroupId
  1747. filePath:(NSString* _Nonnull)aFilePath
  1748. progress:(void (^_Nullable)(int progress))aProgressBlock
  1749. completion:(void (^_Nullable)(EMGroupSharedFile *_Nullable aSharedFile, EMError *_Nullable aError))aCompletionBlock;
  1750. /**
  1751. * \~chinese
  1752. * 下载群共享文件。
  1753. *
  1754. * @param aGroupId 群组 ID。
  1755. * @param aFilePath 文件路径。
  1756. * @param aSharedFileId 共享文件 ID。
  1757. * @param aProgressBlock 文件下载进度回调。
  1758. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  1759. *
  1760. * \~english
  1761. * Downloads the share file of group.
  1762. *
  1763. * @param aGroupId The group ID.
  1764. * @param aFilePath The path of file.
  1765. * @param aSharedFileId The shared file ID.
  1766. * @param aProgressBlock The block of attachment upload progress
  1767. * @param aCompletionBlock The completion block, which contains the error message if the method fails.
  1768. */
  1769. - (void)downloadGroupSharedFileWithId:(NSString *_Nonnull)aGroupId
  1770. filePath:(NSString *_Nonnull)aFilePath
  1771. sharedFileId:(NSString *_Nonnull)aSharedFileId
  1772. progress:(void (^_Nullable)(int progress))aProgressBlock
  1773. completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
  1774. /**
  1775. * \~chinese
  1776. * 删除群共享文件。
  1777. *
  1778. * @param aGroupId 群组 ID。
  1779. * @param aSharedFileId 共享文件 ID。
  1780. * @param pError 错误信息。
  1781. *
  1782. * @result 群组实例。
  1783. *
  1784. * \~english
  1785. * Removes the share file of the group.
  1786. *
  1787. * This is a synchronous method and blocks the current thread.
  1788. *
  1789. * @param aGroupId The group ID.
  1790. * @param aSharedFileId The share file ID.
  1791. * @param pError The error information if the method fails: Error.
  1792. *
  1793. * @result The group instance.
  1794. */
  1795. - (EMGroup * _Nullable)removeGroupSharedFileWithId:(NSString *_Nonnull)aGroupId
  1796. sharedFileId:(NSString *_Nonnull)aSharedFileId
  1797. error:(EMError **_Nullable)pError;
  1798. /**
  1799. * \~chinese
  1800. * 删除群共享文件。
  1801. *
  1802. * @param aGroupId 群组 ID。
  1803. * @param aSharedFileId 共享文件 ID。
  1804. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  1805. *
  1806. * \~english
  1807. * Removes the share file of group.
  1808. *
  1809. * @param aGroupId The group ID.
  1810. * @param aSharedFileId The share file ID.
  1811. * @param aCompletionBlock The completion block, which contains the error message if the method fails.
  1812. */
  1813. - (void)removeGroupSharedFileWithId:(NSString *_Nonnull)aGroupId
  1814. sharedFileId:(NSString *_Nonnull)aSharedFileId
  1815. completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
  1816. /**
  1817. * \~chinese
  1818. * 修改群公告。
  1819. *
  1820. * 该方法只有管理员或者群主才有权限调用。
  1821. *
  1822. * @param aGroupId 群组 ID。
  1823. * @param aAnnouncement 群公告。
  1824. * @param pError 错误信息。
  1825. *
  1826. * @result 群组实例。
  1827. *
  1828. * \~english
  1829. * Updates the announcement of group.
  1830. *
  1831. * Only the chatroom owner or admin can call this method.
  1832. *
  1833. * This is a synchronous method and blocks the current thread.
  1834. *
  1835. * @param aGroupId The group ID.
  1836. * @param aAnnouncement The announcement of the group.
  1837. * @param pError The error information if the method fails: Error.
  1838. *
  1839. * @result The group instance.
  1840. */
  1841. - (EMGroup * _Nullable)updateGroupAnnouncementWithId:(NSString *_Nonnull)aGroupId
  1842. announcement:(NSString *_Nullable)aAnnouncement
  1843. error:(EMError **_Nullable)pError;
  1844. /**
  1845. * \~chinese
  1846. * 修改群公告。
  1847. *
  1848. * 该方法只有管理员或者群主才有权限调用。
  1849. *
  1850. * 异步方法。
  1851. *
  1852. * @param aGroupId 群组 ID。
  1853. * @param aAnnouncement 群公告。
  1854. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  1855. *
  1856. * \~english
  1857. * Updates the announcement of group.
  1858. *
  1859. * Only the chatroom owner or admin can call this method.
  1860. *
  1861. * This is an asynchronous method.
  1862. *
  1863. * @param aGroupId The group ID.
  1864. * @param aAnnouncement The announcement of the group.
  1865. * @param aCompletionBlock The completion block, which contains the error message if the method fails.
  1866. *
  1867. */
  1868. - (void)updateGroupAnnouncementWithId:(NSString *_Nonnull)aGroupId
  1869. announcement:(NSString *_Nullable)aAnnouncement
  1870. completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
  1871. /**
  1872. * \~chinese
  1873. * 修改群扩展信息。
  1874. *
  1875. * 该方法只有群主才有权限调用。
  1876. *
  1877. * @param aGroupId 群组 ID。
  1878. * @param aExt 扩展信息
  1879. * @param pError 错误信息。
  1880. *
  1881. * @result 群组实例。
  1882. *
  1883. * \~english
  1884. * Updates the extended of the group.
  1885. *
  1886. * Only the owner of the group can call this method.
  1887. *
  1888. * This is a synchronous method and blocks the current thread.
  1889. *
  1890. * @param aGroupId The group ID.
  1891. * @param aExt The extended information of the group.
  1892. * @param pError The error information if the method fails: Error.
  1893. *
  1894. * @result The group instance.
  1895. */
  1896. - (EMGroup * _Nullable)updateGroupExtWithId:(NSString *_Nonnull)aGroupId
  1897. ext:(NSString *_Nullable)aExt
  1898. error:(EMError **_Nullable)pError;
  1899. /**
  1900. * \~chinese
  1901. * 修改群扩展信息。
  1902. *
  1903. * 该方法只有群主才有权限调用。
  1904. *
  1905. * @param aGroupId 群组 ID。
  1906. * @param aExt 扩展信息。
  1907. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  1908. *
  1909. * \~english
  1910. * Updates the extended information of the group.
  1911. *
  1912. * Only the group owner can call this method.
  1913. *
  1914. * @param aGroupId The group ID.
  1915. * @param aExt The extended information of the group.
  1916. * @param aCompletionBlock The completion block, which contains the error message if the method fails.
  1917. *
  1918. */
  1919. - (void)updateGroupExtWithId:(NSString *_Nonnull)aGroupId
  1920. ext:(NSString *_Nullable)aExt
  1921. completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
  1922. #pragma mark - Edit Public Group
  1923. /**
  1924. * \~chinese
  1925. * 加入一个公开群组,群类型应该是 EMGroupStylePublicOpenJoin。
  1926. *
  1927. * 同步方法,会阻塞当前线程。
  1928. *
  1929. * @param aGroupId 公开群组的 ID。
  1930. * @param pError 错误信息。
  1931. *
  1932. * @result 所加入的公开群组。
  1933. *
  1934. * \~english
  1935. * Joins a public group. The group style should be EMGroupStylePublicOpenJoin.
  1936. *
  1937. * This is a synchronous method and blocks the current thread.
  1938. *
  1939. * @param aGroupId The public group ID.
  1940. * @param pError The error information if the method fails: Error.
  1941. *
  1942. * @result The group instance.
  1943. */
  1944. - (EMGroup * _Nullable)joinPublicGroup:(NSString *_Nonnull)aGroupId
  1945. error:(EMError **_Nullable)pError;
  1946. /**
  1947. * \~chinese
  1948. * 加入一个公开群组,群类型应该是 EMGroupStylePublicOpenJoin。
  1949. *
  1950. * @param aGroupId 公开群组的 ID。
  1951. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  1952. *
  1953. * \~english
  1954. * Joins a public group. The group style should be EMGroupStylePublicOpenJoin.
  1955. *
  1956. * @param aGroupId The public group ID。
  1957. * @param aCompletionBlock The completion block, which contains the error message if the method fails.
  1958. *
  1959. */
  1960. - (void)joinPublicGroup:(NSString *_Nonnull)aGroupId
  1961. completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
  1962. /**
  1963. * \~chinese
  1964. * 申请加入一个需批准的公开群组,群类型应该是 EMGroupStylePublicJoinNeedApproval。
  1965. *
  1966. * 同步方法,会阻塞当前线程。
  1967. *
  1968. * @param aGroupId 公开群组的 ID。
  1969. * @param aMessage 请求加入的信息。
  1970. * @param pError 错误信息。
  1971. *
  1972. * @result 申请加入的公开群组。
  1973. *
  1974. * \~english
  1975. * The request to join a public group. The group style should be EMGroupStylePublicJoinNeedApproval.
  1976. *
  1977. * This is a synchronous method and blocks the current thread.
  1978. *
  1979. * @param aGroupId The public group ID。
  1980. * @param aMessage The message in the request.
  1981. * @param pError The error information if the method fails: Error.
  1982. *
  1983. * @result The group instance.
  1984. */
  1985. - (EMGroup * _Nullable)applyJoinPublicGroup:(NSString *_Nonnull)aGroupId
  1986. message:(NSString *_Nullable)aMessage
  1987. error:(EMError **_Nullable)pError;
  1988. /**
  1989. * \~chinese
  1990. * 申请加入一个需批准的公开群组,群类型应该是 EMGroupStylePublicJoinNeedApproval。
  1991. *
  1992. * @param aGroupId 公开群组的 ID。
  1993. * @param aMessage 请求加入的信息。
  1994. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  1995. *
  1996. *
  1997. * \~english
  1998. * Requests to join a public group. The group style should be EMGroupStylePublicJoinNeedApproval.
  1999. *
  2000. * @param aGroupId The public group ID.
  2001. * @param aMessage The information in the request.
  2002. * @param aCompletionBlock The completion block, which contains the error message if the method fails.
  2003. *
  2004. */
  2005. - (void)requestToJoinPublicGroup:(NSString *_Nonnull)aGroupId
  2006. message:(NSString *_Nullable)aMessage
  2007. completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
  2008. #pragma mark - Application
  2009. /**
  2010. * \~chinese
  2011. * 批准入群申请。
  2012. *
  2013. * 该方法只有群主才有权限调用。
  2014. *
  2015. * 同步方法,会阻塞当前线程。
  2016. *
  2017. * @param aGroupId 所申请的群组 ID。
  2018. * @param aUsername 申请人。
  2019. *
  2020. * @result 错误信息。
  2021. *
  2022. * \~english
  2023. * Accepts a group request.
  2024. *
  2025. * Only the group owner can call this method.
  2026. *
  2027. * This is a synchronous method and blocks the current thread.
  2028. *
  2029. * @param aGroupId The group ID.
  2030. * @param aUsername The user who sends the request for join the group.
  2031. *
  2032. * @result Error
  2033. */
  2034. - (EMError *)acceptJoinApplication:(NSString *_Nonnull)aGroupId
  2035. applicant:(NSString *_Nonnull)aUsername;
  2036. /**
  2037. * \~chinese
  2038. * 批准入群申请。
  2039. *
  2040. * 该方法只有群主才有权限调用。
  2041. *
  2042. * 异步方法。
  2043. *
  2044. * @param aGroupId 所申请的群组 ID。
  2045. * @param aUsername 申请人。
  2046. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  2047. *
  2048. *
  2049. * \~english
  2050. * Approves a group request.
  2051. *
  2052. * Only the group owner can call this method.
  2053. *
  2054. * This is an asynchronous method.
  2055. *
  2056. * @param aGroupId The group ID.
  2057. * @param aUsername The user who sends the request for join the group.
  2058. * @param aCompletionBlock The completion block, which contains the error message if the method fails.
  2059. *
  2060. */
  2061. - (void)approveJoinGroupRequest:(NSString *_Nonnull)aGroupId
  2062. sender:(NSString *_Nonnull)aUsername
  2063. completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
  2064. /**
  2065. * \~chinese
  2066. * 拒绝入群申请。
  2067. *
  2068. * 该方法只有群主才有权限调用。
  2069. *
  2070. * 同步方法,会阻塞当前线程。
  2071. *
  2072. * @param aGroupId 被拒绝的群组 ID。
  2073. * @param aUsername 申请人。
  2074. * @param aReason 拒绝理由。
  2075. *
  2076. * @result 错误信息。
  2077. *
  2078. * \~english
  2079. * Declines a group request.
  2080. *
  2081. * Only the group owner can call this method.
  2082. *
  2083. * This is a synchronous method and blocks the current thread.
  2084. *
  2085. * @param aGroupId The group ID.
  2086. * @param aUsername The user who sends the request for join the group.
  2087. * @param aReason The reason of declining.
  2088. *
  2089. * @result Error
  2090. */
  2091. - (EMError *)declineJoinApplication:(NSString *_Nonnull)aGroupId
  2092. applicant:(NSString *_Nonnull)aUsername
  2093. reason:(NSString *_Nullable)aReason;
  2094. /**
  2095. * \~chinese
  2096. * 拒绝入群申请。
  2097. *
  2098. * 该方法只有群主才有权限调用。
  2099. *
  2100. * 异步方法。
  2101. *
  2102. * @param aGroupId 被拒绝的群组 ID。
  2103. * @param aUsername 申请人。
  2104. * @param aReason 拒绝理由。
  2105. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  2106. *
  2107. *
  2108. * \~english
  2109. * Declines a group request.
  2110. *
  2111. * Only the group owner can call this method.
  2112. *
  2113. * This is an asynchronous method.
  2114. *
  2115. * @param aGroupId The group ID.
  2116. * @param aUsername The user who sends the request for join the group.
  2117. * @param aReason The reason for declining.
  2118. * @param aCompletionBlock The completion block, which contains the error message if the method fails.
  2119. *
  2120. */
  2121. - (void)declineJoinGroupRequest:(NSString *_Nonnull)aGroupId
  2122. sender:(NSString *_Nonnull)aUsername
  2123. reason:(NSString *_Nullable)aReason
  2124. completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
  2125. /**
  2126. * \~chinese
  2127. * 接受入群邀请。
  2128. *
  2129. * 同步方法,会阻塞当前线程。
  2130. *
  2131. * @param groupId 接受的群组 ID。
  2132. * @param aUsername 邀请者。
  2133. * @param pError 错误信息。
  2134. *
  2135. * @result 接受的群组实例。
  2136. *
  2137. * \~english
  2138. * Accepts a group invitation.
  2139. *
  2140. * This is a synchronous method and blocks the current thread.
  2141. *
  2142. * @param aGroupId The group ID.
  2143. * @param aUsername The user who initiates the invitation.
  2144. * @param pError The error information if the method fails: Error.
  2145. *
  2146. * @result The group instance.
  2147. */
  2148. - (EMGroup * _Nullable)acceptInvitationFromGroup:(NSString *_Nonnull)aGroupId
  2149. inviter:(NSString *_Nonnull)aUsername
  2150. error:(EMError **_Nullable)pError;
  2151. /**
  2152. * \~chinese
  2153. * 接受入群邀请。
  2154. *
  2155. * 异步方法。
  2156. *
  2157. * @param groupId 接受的群组 ID。
  2158. * @param aUsername 邀请者。
  2159. * @param pError 错误信息。
  2160. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  2161. *
  2162. *
  2163. * \~english
  2164. * Accepts a group invitation.
  2165. *
  2166. * This is an asynchronous method.
  2167. *
  2168. * @param aGroupId The group ID.
  2169. * @param aUsername The user who initiates the invitation.
  2170. * @param aCompletionBlock The completion block, which contains the error message if the method fails.
  2171. *
  2172. */
  2173. - (void)acceptInvitationFromGroup:(NSString *_Nonnull)aGroupId
  2174. inviter:(NSString *_Nonnull)aUsername
  2175. completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
  2176. /**
  2177. * \~chinese
  2178. * 拒绝入群邀请。
  2179. *
  2180. * 同步方法,会阻塞当前线程。
  2181. *
  2182. * @param aGroupId 被拒绝的群组 ID。
  2183. * @param aUsername 邀请人。
  2184. * @param aReason 拒绝理由。
  2185. *
  2186. * @result 错误信息。
  2187. *
  2188. * \~english
  2189. * Declines a group invitation.
  2190. *
  2191. * This is a synchronous method and blocks the current thread.
  2192. *
  2193. * @param aGroupId The group ID.
  2194. * @param aUsername The user who initiates the invitation.
  2195. * @param aReason The reason for declining.
  2196. *
  2197. * @result The error information if the method fails: Error.
  2198. */
  2199. - (EMError *)declineInvitationFromGroup:(NSString *_Nonnull)aGroupId
  2200. inviter:(NSString *_Nonnull)aUsername
  2201. reason:(NSString *_Nullable)aReason;
  2202. /**
  2203. * \~chinese
  2204. * 拒绝入群邀请。
  2205. *
  2206. * 异步方法。
  2207. *
  2208. * @param aGroupId 被拒绝的群组 ID。
  2209. * @param aInviter 邀请人。
  2210. * @param aReason 拒绝理由。
  2211. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  2212. *
  2213. *
  2214. * \~english
  2215. * Declines a group invitation.
  2216. *
  2217. * This is an asynchronous method.
  2218. *
  2219. * @param aGroupId The group ID.
  2220. * @param aInviter The user who send the invitation.
  2221. * @param aReason The reason of declining.
  2222. * @param aCompletionBlock The completion block, which contains the error message if the method fails.
  2223. *
  2224. */
  2225. - (void)declineGroupInvitation:(NSString *_Nonnull)aGroupId
  2226. inviter:(NSString *_Nonnull)aInviter
  2227. reason:(NSString *_Nullable)aReason
  2228. completion:(void (^_Nullable)(EMError *_Nullable aError))aCompletionBlock;
  2229. /**
  2230. * \~chinese
  2231. * 从服务器分页获取当前用户加入的群组。
  2232. * *
  2233. * 异步方法。
  2234. *
  2235. * @param aPageNum 当前页码,从 0 开始。该参数设置后,SDK 从指定位置按照用户加入群组的逆序查询。
  2236. * 首次查询设置为 0,SDK 从最新加入的群组开始查询。
  2237. * @param aPageSize 每次期望获取的社区数量。取值范围为 [1,20]。
  2238. * @param aNeedMemberCount 是否需要群组成员数。
  2239. * - `YES`:是;
  2240. * - `NO`:否;
  2241. * @param aNeedRole 是否需要当前用户的角色。
  2242. * - `YES`:是;
  2243. * - `NO`:否;
  2244. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  2245. *
  2246. * \~english
  2247. * Uses the pagination to get the number group that you joined.
  2248. * This method gets data from the server.
  2249. *
  2250. * This is an asynchronous method.
  2251. *
  2252. * @param aPageNum The current page number, starting from 0.
  2253. * After this parameter is set, the SDK gets data from the specified position in the reverse chronological order of when the user joined groups.
  2254. * At the first method call, if you set this parameter as `0`, the SDK gets data starting from the latest group that the user joined.
  2255. * @param aPageSize The number of groups that you expect to get on each page. The value range is [1,20].
  2256. * @param aNeedMemberCount need member count Whether the number of group members is required.
  2257. * - `YES`:Yes.
  2258. * - `NO`:No.
  2259. * @param aNeedRole need role Whether the role of the current user in the group is required.
  2260. * - `YES`:Yes.
  2261. * - `NO`:No.
  2262. * @param aCompletionBlock The completion block, which contains the error message if the method fails.
  2263. *
  2264. */
  2265. - (void)getJoinedGroupsFromServerWithPage:(NSInteger)aPageNum
  2266. pageSize:(NSInteger)aPageSize
  2267. needMemberCount:(BOOL)aNeedMemberCount
  2268. needRole:(BOOL)aNeedRole
  2269. completion:(void (^_Nullable)(NSArray<EMGroup *> *_Nullable aList, EMError *_Nullable aError))aCompletionBlock;
  2270. #pragma mark - Apns
  2271. /**
  2272. * \~chinese
  2273. * 屏蔽/取消屏蔽群组消息的推送。
  2274. *
  2275. * 同步方法,会阻塞当前线程。
  2276. *
  2277. * 已废弃,请用 {@link IEMPushManager::updatePushServiceForGroups:disablePush:} 代替。
  2278. *
  2279. * @param aGroupId 群组 ID。
  2280. * @param aIgnore 是否屏蔽。
  2281. *
  2282. * @result 错误信息。
  2283. *
  2284. * \~english
  2285. * Blocks/unblocks group message‘s push notification.
  2286. *
  2287. * This is a synchronous method and blocks the current thread.
  2288. *
  2289. * Deprecated, please use {@link IEMPushManager::updatePushServiceForGroups:disablePush:} instead.
  2290. *
  2291. * @param aGroupId The group ID.
  2292. * @param aIsIgnore Whether to show or ignore the push notification.
  2293. *
  2294. * @result The error information if the method fails: Error.
  2295. */
  2296. - (EMError *)ignoreGroupPush:(NSString *)aGroupId
  2297. ignore:(BOOL)aIsIgnore EM_DEPRECATED_IOS(3_3_2, 3_8_3, "Use -IEMPushManager::updatePushServiceForGroups:disablePush:");
  2298. /**
  2299. * \~chinese
  2300. * 屏蔽/取消屏蔽群组消息的推送。
  2301. *
  2302. * 已废弃,请用 {@link IEMPushManager::updatePushServiceForGroups:disablePush:completion:} 代替。
  2303. *
  2304. * @param aGroupId 群组 ID。
  2305. * @param aIsEnable 是否允许推送。
  2306. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  2307. *
  2308. *
  2309. * \~english
  2310. * Blocks/unblocks the group message‘s push notification.
  2311. *
  2312. * Deprecated, please use {@link IEMPushManager::updatePushServiceForGroups:disablePush:completion:} instead.
  2313. *
  2314. * @param aGroupId The group ID.
  2315. * @param aIsEnable Whether to block or unblock the push notification.
  2316. * @param aCompletionBlock The completion block, which contains the error message if the method fails.
  2317. *
  2318. */
  2319. - (void)updatePushServiceForGroup:(NSString *)aGroupId
  2320. isPushEnabled:(BOOL)aIsEnable
  2321. completion:(void (^)(EMGroup *aGroup, EMError *aError))aCompletionBlock EM_DEPRECATED_IOS(3_3_2, 3_8_3, "Use -IEMPushManager::updatePushServiceForGroups:disablePush:completion:");
  2322. /**
  2323. * \~chinese
  2324. * 屏蔽/取消屏蔽群组消息的推送。
  2325. *
  2326. * 已废弃,请用 {@link IEMPushManager::updatePushServiceForGroups:disablePush:} 代替。
  2327. *
  2328. * 同步方法,会阻塞当前线程。
  2329. *
  2330. * @param aGroupIDs 群组 ID 列表。
  2331. * @param aIgnore 是否屏蔽。
  2332. *
  2333. * @result 错误信息。
  2334. *
  2335. * \~english
  2336. * Blocks/unblocks the group message‘s push notification.
  2337. *
  2338. * Deprecated, please use {@link IEMPushManager::updatePushServiceForGroups:disablePush:} instead.
  2339. *
  2340. * This is a synchronous method and blocks the current thread.
  2341. *
  2342. * @param aGroupIDs The group ID list.
  2343. * @param aIsIgnore Whether to show or ignore the push notification.
  2344. *
  2345. * @result The error information if the method fails: Error.
  2346. */
  2347. - (EMError *)ignoreGroupsPush:(NSArray *)aGroupIDs
  2348. ignore:(BOOL)aIsIgnore EM_DEPRECATED_IOS(3_3_2, 3_8_3, "Use -IEMPushManager::updatePushServiceForGroups:disablePush:");
  2349. /**
  2350. * \~chinese
  2351. * 屏蔽/取消屏蔽群组消息的推送。
  2352. *
  2353. * 已废弃,请用 {@link IEMPushManager::updatePushServiceForGroups:disablePush:completion:} 代替。
  2354. *
  2355. * @param aGroupIDs 群组 ID 列表。
  2356. * @param aIsEnable 是否允许推送。
  2357. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  2358. *
  2359. *
  2360. * \~english
  2361. * Blocks/unblocks the group message‘s push notification.
  2362. *
  2363. * Deprecated, please use {@link IEMPushManager::updatePushServiceForGroups:disablePush:completion:} instead.
  2364. *
  2365. * @param aGroupIDs The group ID list.
  2366. * @param aIsEnable Whether to enable group messages push.
  2367. * @param aCompletionBlock The completion block, which contains the error message if the method fails.
  2368. *
  2369. */
  2370. - (void)updatePushServiceForGroups:(NSArray *)aGroupIDs
  2371. isPushEnabled:(BOOL)aIsEnable
  2372. completion:(void (^)(NSArray *groups, EMError *aError))aCompletionBlock EM_DEPRECATED_IOS(3_3_2, 3_8_3, "Use -IEMPushManager::updatePushServiceForGroups:disablePush:completion:");
  2373. #pragma mark - Group member attributes
  2374. /**
  2375. * \~chinese
  2376. * 设置群成员自定义属性。
  2377. *
  2378. * @param groupId 群组 ID。
  2379. * @param userId 要设置自定义属性的群成员的用户 ID。
  2380. * @param attributes 要设置的群成员自定义属性的 map,为 key-value 格式。对于一个 key-value 键值对,若 value 设置空字符串即删除该自定义属性。
  2381. * @param completion 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  2382. *
  2383. * \~english
  2384. * Sets custom attributes of a group member.
  2385. *
  2386. * @param groupId The group ID.
  2387. * @param userId The user ID of the group member for whom the custom attributes are set.
  2388. * @param attributes The map of custom attributes in key-value format. In a key-value pair, if the value is set to an empty string, the custom attribute will be deleted.
  2389. * @param completion The completion block, which contains the error message if the method call fails.
  2390. */
  2391. - (void)setMemberAttribute:(NSString *_Nonnull)groupId userId:(NSString *_Nonnull)userId attributes:(NSDictionary<NSString*,NSString*> *_Nonnull)attributes completion:(void (^_Nullable)(EMError *_Nullable error))completionBlock;
  2392. /**
  2393. * \~chinese
  2394. * 获取单个群成员所有自定义属性。
  2395. *
  2396. * @param groupId 群组 ID。
  2397. * @param userId 要获取的自定义属性的群成员的用户 ID。
  2398. * @param completion 该方法完成调用的回调,返回错误 EMError 和获取的属性的 Map。
  2399. * - 若该方法调用成功,返回获取的属性的 Map,包含获取的所有键值对,此时 EMError 为空。
  2400. * - 如果该方法调用失败,返回调用失败的原因,即 EMError,此时属性的 Map 为空。
  2401. * - 若获取的属性的 Map 为空,而且 EMError 也为空,表示该群成员未设置任何属性。
  2402. * \~english
  2403. * Gets all custom attributes of a group member.
  2404. *
  2405. * @param groupId The group ID.
  2406. * @param userId The user ID of the group member whose all custom attributes are retrieved.
  2407. * @param completion The completion block, which contains the map of all retrieved attributes and the error message (EMError) if the method call fails:
  2408. * - If the method call succeeds, the SDK returns the map of retrieved custom attributes in key-value pairs. In this case, EMError is empty.
  2409. * - If the method call fails, the SDK returns the reason for the failure (EMError). In this case, the map of custom attributes is empty.
  2410. * - If both the map of custom attributes and EMError are empty, no custom attribute is set for the group member.
  2411. */
  2412. - (void)fetchMemberAttribute:(NSString *_Nonnull)groupId userId:(NSString *_Nonnull)userId completion:(void (^ _Nullable)(NSDictionary<NSString *,NSString *> * _Nullable, EMError * _Nullable))completionBlock;
  2413. /**
  2414. * \~chinese
  2415. *
  2416. * 根据指定的属性 key 获取多个群成员的自定义属性
  2417. * @param groupId 群组 ID。
  2418. * @param userIds 要获取自定义属性的群成员的用户 ID 数组。(最多10个,多则报错)
  2419. * @param keys 要获取自定义属性的 key 的数组。
  2420. * @param completion 该方法完成调用的回调,返回错误 EMError 和获取的属性的 Map。
  2421. * - 若该方法调用成功,返回获取的属性的 Map,包含获取的所有键值对,此时 EMError 为空。若某个群成员未设置自定义属性,其属性的 Map 为空。
  2422. * - 如果该方法调用失败,会包含调用失败的原因,此时属性的 Map 为空。
  2423. * - 若获取这些群成员的属性的 Map 为空,而且 EMError 也为空,表示这些群成员未设置任何属性。
  2424. *
  2425. * \~english
  2426. * Gets custom attributes of multiple group members by attribute key.
  2427. *
  2428. * @param groupId The group ID.
  2429. * @param userIds The array of user IDs of group members whose custom attributes are retrieved.(limitation is ten.More than callback error. )
  2430. * @param keys The array of keys of custom attributes to be retrieved.
  2431. * @param completion The completion block, which contains the map of retrieved attributes and the error message (EMError) if the method call fails.
  2432. * - If the method call succeeds, the SDK returns the map of retrieved custom attributes in key-value pairs. In this case, EMError is empty. If no custom attribute is set for a group members, the map of custom attribute is empty for this member.
  2433. * - If the method call fails, the SDK returns the reason for the failure (EMError). In this case, the map of custom attributes is empty for the group members.
  2434. * - If both the map of custom attributes and EMError are empty, no custom attribute is set for the group members.
  2435. */
  2436. - (void)fetchMembersAttributes:(NSString *_Nonnull)groupId userIds:(NSArray<__kindof NSString *> *_Nonnull)userIds keys:(NSArray<__kindof NSString *> *_Nonnull)keys completion:(void (^_Nullable)(NSDictionary<NSString*,NSDictionary<NSString*,NSString*>*> *_Nullable attributes, EMError *_Nullable error))completionBlock;
  2437. #pragma mark - EM_DEPRECATED_IOS 3.8.8
  2438. /**
  2439. * \~chinese
  2440. * 按数目从服务器获取自己加入的群组。
  2441. *
  2442. * 已废弃,请用 {@link getJoinedGroupsFromServerWithPage:pageSize:needMemberCount:needRole:error:completion:} 代替。
  2443. *
  2444. * 异步方法。
  2445. *
  2446. * @param aPageNum 获取自己加入群的游标,首次调用传空。
  2447. * @param aPageSize 期望返回结果的数量, 如果小于 0 则一次返回所有结果。
  2448. * @param aCompletionBlock 该方法完成调用的回调。如果该方法调用失败,会包含调用失败的原因。
  2449. *
  2450. * \~english
  2451. * Gets the pagesize number group you joined from the server.
  2452. *
  2453. * Deprecated, please use {@link getJoinedGroupsFromServerWithPage:pageSize:needMemberCount:needRole:error:completion:} instead.
  2454. *
  2455. * This is an asynchronous method.
  2456. *
  2457. * @param aPageNum The cursor when joins the group. Sets the parameter as nil for the first time.
  2458. * @param aPageSize The number of results expected to be returned, if <0 then all results will be returned at once.
  2459. * @param aCompletionBlock The completion block, which contains the error message if the method fails.
  2460. *
  2461. */
  2462. - (void)getJoinedGroupsFromServerWithPage:(NSInteger)aPageNum
  2463. pageSize:(NSInteger)aPageSize
  2464. completion:(void (^_Nullable)(NSArray<EMGroup *> *aList, EMError *_Nullable aError))aCompletionBlock
  2465. __deprecated_msg("Use -getJoinedGroupsFromServerWithPage:pageSize:needMemberCount:needRole:error:completion: instead");
  2466. @end