HyphenateChatSDK 4.2.3
Instance Methods | List of all members
<IEMChatroomManager> Protocol Reference

#import <IEMChatroomManager.h>

Inheritance diagram for <IEMChatroomManager>:

Instance Methods

(void) - addDelegate:delegateQueue:
 
(void) - removeDelegate:
 
(EMPageResult< EMChatroom * > *_Nullable) - getChatroomsFromServerWithPage:pageSize:error:
 
(void) - getChatroomsFromServerWithPage:pageSize:completion:
 
(EMChatroom *) - joinChatroom:error:
 
(void) - joinChatroom:completion:
 
(void) - joinChatroom:ext:leaveOtherRooms:completion:
 
(void) - leaveChatroom:error:
 
(void) - leaveChatroom:completion:
 
(EMChatroom *_Nullable) - getChatroomSpecificationFromServerWithId:error:
 
(void) - getChatroomSpecificationFromServerWithId:completion:
 
(EMCursorResult< NSString * > *_Nullable) - getChatroomMemberListFromServerWithId:cursor:pageSize:error:
 
(void) - getChatroomMemberListFromServerWithId:cursor:pageSize:completion:
 
(NSString *_Nullable) - getChatroomAnnouncementWithId:error:
 
(void) - getChatroomAnnouncementWithId:completion:
 

Detailed Description

A class that manages the chatrooms.

Method Documentation

◆ addDelegate:delegateQueue:

- (void) addDelegate: (id< EMChatroomManagerDelegate > _Nonnull)  aDelegate
delegateQueue: (dispatch_queue_t _Nullable)  aQueue 
required

Adds the SDK delegate.

Parameters
aDelegateThe delegate that you want to add: ChatroomManagerDelegate.
aQueue(Optional) The queue of calling the delegate methods. To run the app on the main thread, set this parameter as nil.

◆ getChatroomAnnouncementWithId:completion:

- (void) getChatroomAnnouncementWithId: (NSString *_Nonnull)  aChatroomId
completion: (void(^)(NSString *_Nullable aAnnouncement, EMError *_Nullable aError))  aCompletionBlock 
required

Gets the announcement of a chatroom from the server.

This is an asynchronous method.

Parameters
aChatroomIdThe chatroom ID.
aCompletionBlockThe completion block, which contains the error message if the method call fails.

◆ getChatroomAnnouncementWithId:error:

- (NSString *_Nullable) getChatroomAnnouncementWithId: (NSString *_Nonnull)  aChatroomId
error: (EMError **_Nullable)  pError 
required

Gets the announcement of a chatroom from the server.

This is a synchronous method and blocks the current thread.

Parameters
aChatroomIdThe chatroom ID.
pErrorThe error information if the method fails: Error.
Returns
The announcement of chatroom.

◆ getChatroomMemberListFromServerWithId:cursor:pageSize:completion:

- (void) getChatroomMemberListFromServerWithId: (NSString *_Nonnull)  aChatroomId
cursor: (NSString *_Nullable)  aCursor
pageSize: (NSInteger)  aPageSize
completion: (void(^)(EMCursorResult< NSString * > *_Nullable aResult, EMError *_Nullable aError))  aCompletionBlock 
required

Gets the list of chatroom members from the server.

This is an asynchronous method.

Parameters
aChatroomIdThe chatroom ID.
aCursorThe cursor. Set this parameter as nil when you call this method for the first time.
aPageSizeThe page size.
aCompletionBlockThe completion block, which contains the error message if the method call fails.

◆ getChatroomMemberListFromServerWithId:cursor:pageSize:error:

- (EMCursorResult< NSString * > *_Nullable) getChatroomMemberListFromServerWithId: (NSString *_Nonnull)  aChatroomId
cursor: (NSString *_Nullable)  aCursor
pageSize: (NSInteger)  aPageSize
error: (EMError **_Nullable)  pError 
required

Gets the list of chatroom members from the server.

This is a synchronous method and blocks the current thread.

Parameters
aChatroomIdThe chatroom ID.
aCursorThe cursor. Set this parameter as nil when you call this method for the first time.
aPageSizeThe page size.
pErrorThe error information if the method fails: Error.
Returns
The list of chatroom members and the cursor.

◆ getChatroomsFromServerWithPage:pageSize:completion:

- (void) getChatroomsFromServerWithPage: (NSInteger)  aPageNum
pageSize: (NSInteger)  aPageSize
completion: (void(^)(EMPageResult< EMChatroom * > *_Nullable aResult, EMError *_Nullable aError))  aCompletionBlock 
required

Gets the specified number of chat rooms from the server.

This is an asynchronous method.

Parameters
aPageNumThe page number.
aPageSizeThe page size.
aCompletionBlockThe completion block, which contains the error message if the method call fails.

◆ getChatroomsFromServerWithPage:pageSize:error:

- (EMPageResult< EMChatroom * > *_Nullable) getChatroomsFromServerWithPage: (NSInteger)  aPageNum
pageSize: (NSInteger)  aPageSize
error: (EMError **_Nullable)  pError 
required

Gets the specified number of chat rooms from the server.

This is a synchronous method and blocks the current thread.

Parameters
aPageNumThe page number.
aPageSizeThe page size.
pErrorThe error information if the method fails: Error.
Returns
The chat room list. See EMPageResult.

◆ getChatroomSpecificationFromServerWithId:completion:

- (void) getChatroomSpecificationFromServerWithId: (NSString *_Nonnull)  aChatroomId
completion: (void(^)(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))  aCompletionBlock 
required

Fetches the chat room specifications.

This is an asynchronous method.

Parameters
aChatroomIdThe chatroom ID.
aCompletionBlockThe completion block, which contains the error message if the method call fails.

◆ getChatroomSpecificationFromServerWithId:error:

- (EMChatroom *_Nullable) getChatroomSpecificationFromServerWithId: (NSString *_Nonnull)  aChatroomId
error: (EMError *_Nullable *)  pError 
required

Fetches the specific chatroom.

This is a synchronous method and blocks the current thread.

Parameters
aChatroomIdThe chatroom ID.
pErrorThe error information if the method fails: Error.
Returns
The chatroom instance. See EMChatroom.

◆ joinChatroom:completion:

- (void) joinChatroom: (NSString *_Nonnull)  aChatroomId
completion: (void(^)(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))  aCompletionBlock 
required

Joins a chatroom.

This is an asynchronous method.

Parameters
aChatroomIdThe chatroom ID.
aCompletionBlockThe completion block, which contains the error message if the method call fails.

◆ joinChatroom:error:

- (EMChatroom *) joinChatroom: (NSString *_Nonnull)  aChatroomId
error: (EMError **_Nullable)  pError 
required

Joins a chatroom.

This is a synchronous method and blocks the current thread.

Parameters
aChatroomIdThe chatroom ID.
pErrorThe error information if the method fails: Error.
Returns
The chatroom instance.

◆ joinChatroom:ext:leaveOtherRooms:completion:

- (void) joinChatroom: (NSString *_Nonnull)  aChatroomId
ext: (NSString *_Nullable)  ext
leaveOtherRooms: (BOOL)  leaveOtherRooms
completion: (void(^)(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))  aCompletionBlock 
required

Joins the chat room.

This is an asynchronous method.

Parameters
aChatroomIdThe chat room ID.
extThe extension information.
leaveOtherRoomsWhether to leave all the currently joined chat rooms when joining a chat room.
  • YES:Yes. The user joins the chat room, while leaving all other chat rooms.
  • (Default) NO: No. The user joins the chat room, without leaving all other chat rooms.
aCompletionBlockThe completion block, which contains the error message if the method fails.

◆ leaveChatroom:completion:

- (void) leaveChatroom: (NSString *_Nonnull)  aChatroomId
completion: (void(^)(EMError *_Nullable aError))  aCompletionBlock 
required

Leaves a chatroom.

This is an asynchronous method.

Parameters
aChatroomIdThe chatroom ID.
aCompletionBlockThe completion block, which contains the error message if the method call fails.

◆ leaveChatroom:error:

- (void) leaveChatroom: (NSString *_Nonnull)  aChatroomId
error: (EMError **_Nullable)  pError 
required

Leaves a chatroom.

This is a synchronous method and blocks the current thread.

Parameters
aChatroomIdThe chatroom ID.
pErrorThe error information if the method fails: Error.

◆ removeDelegate:

- (void) removeDelegate: (id< EMChatroomManagerDelegate > _Nonnull)  aDelegate
required

Removes the delegate.

Parameters
aDelegateThe delegate that you want to remove.

The documentation for this protocol was generated from the following file: