hyphenate_SDK4.0 4.2.3-lite
hyphenate java IM SDK
|
Public Member Functions | |
void | addChatRoomChangeListener (EMChatRoomChangeListener listener) |
void | removeChatRoomListener (EMChatRoomChangeListener listener) |
void | joinChatRoom (final String roomId, final EMValueCallBack< EMChatRoom > callback) |
void | joinChatRoom (final String roomId, boolean leaveOtherRooms, String ext, final EMValueCallBack< EMChatRoom > callback) |
void | leaveChatRoom (final String roomId) |
void | leaveChatRoom (final String roomId, EMCallBack callback) |
EMPageResult< EMChatRoom > | fetchPublicChatRoomsFromServer (int pageNum, int pageSize) throws HyphenateException |
void | asyncFetchPublicChatRoomsFromServer (final int pageNum, final int pageSize, final EMValueCallBack< EMPageResult< EMChatRoom > > callback) |
EMChatRoom | fetchChatRoomFromServer (String roomId) throws HyphenateException |
EMChatRoom | fetchChatRoomFromServer (String roomId, boolean fetchMembers) throws HyphenateException |
void | asyncFetchChatRoomFromServer (final String roomId, final EMValueCallBack< EMChatRoom > callback) |
EMChatRoom | getChatRoom (String roomId) |
EMCursorResult< String > | fetchChatRoomMembers (String chatRoomId, String cursor, int pageSize) throws HyphenateException |
void | asyncFetchChatRoomMembers (final String chatRoomId, final String cursor, final int pageSize, final EMValueCallBack< EMCursorResult< String > > callBack) |
String | fetchChatRoomAnnouncement (String chatRoomId) throws HyphenateException |
void | asyncFetchChatRoomAnnouncement (final String chatRoomId, final EMValueCallBack< String > callBack) |
The chat room manager, which manages users joining and existing the chat room and getting the chat room list, and manages member privileges. For example, joining a chat room:
void com.hyphenate.chat.EMChatRoomManager.addChatRoomChangeListener | ( | EMChatRoomChangeListener | listener | ) |
Adds a chat room event listener.
Chat room event listeners added with this method can be removed by calling removeChatRoomListener(EMChatRoomChangeListener).
listener | A chat room event listener. See EMChatRoomChangeListener. |
void com.hyphenate.chat.EMChatRoomManager.asyncFetchChatRoomAnnouncement | ( | final String | chatRoomId, |
final EMValueCallBack< String > | callBack | ||
) |
Gets the chat room announcement from the server.
For the synchronous method, see fetchChatRoomAnnouncement(String).
This is an asynchronous method.
chatRoomId | The chat room ID. |
callBack | The completion callback. If this call succeeds, calls EMValueCallBack#onSuccess(Object) and returns the chat room announcement; if this call fails, calls EMValueCallBack#onError(int, String). |
void com.hyphenate.chat.EMChatRoomManager.asyncFetchChatRoomFromServer | ( | final String | roomId, |
final EMValueCallBack< EMChatRoom > | callback | ||
) |
Gets details of a chat room from the server.
This is an asynchronous method.
For the synchronous method, see fetchChatRoomFromServer(String).
roomId | The chat room ID. |
callback | The completion callback. If this call succeeds, calls EMValueCallBack#onSuccess(Object); if this call fails, callsEMValueCallBack#onError(int, String). |
void com.hyphenate.chat.EMChatRoomManager.asyncFetchChatRoomMembers | ( | final String | chatRoomId, |
final String | cursor, | ||
final int | pageSize, | ||
final EMValueCallBack< EMCursorResult< String > > | callBack | ||
) |
Gets the chat room member list.
This is an asynchronous method.
chatRoomId | The chat room ID. |
cursor | The cursor position from which to start getting data. At the first call, if you set the cursor as "null", the SDK gets chat room members in the reverse chronological order of when members joined the chat room. |
pageSize | The number of members that you expect to get on each page. The value range is [1,50]. |
callBack | The completion callback. If this call succeeds, calls EMValueCallBack#onSuccess(Object); If this call fails, calls EMValueCallBack#onError(int, String). |
void com.hyphenate.chat.EMChatRoomManager.asyncFetchPublicChatRoomsFromServer | ( | final int | pageNum, |
final int | pageSize, | ||
final EMValueCallBack< EMPageResult< EMChatRoom > > | callback | ||
) |
Gets chat room data from the server with pagination.
This is an asynchronous method.
pageNum | The page number, starting from 1. |
pageSize | The number of records that you expect to get on each page. The value range is [1,50]. |
callback | The completion callback. If this call succeeds, calls EMValueCallBack#onSuccess(Object). If this call fails, calls EMValueCallBack#onError(int, String). |
String com.hyphenate.chat.EMChatRoomManager.fetchChatRoomAnnouncement | ( | String | chatRoomId | ) | throws HyphenateException |
Gets the chat room announcement from the server.
For the asynchronous method, see asyncFetchChatRoomAnnouncement(String, EMValueCallBack).
This is a synchronous method and blocks the current thread.
chatRoomId | The chat room ID. |
HyphenateException | A description of the exception. See EMError |
EMChatRoom com.hyphenate.chat.EMChatRoomManager.fetchChatRoomFromServer | ( | String | roomId | ) | throws HyphenateException |
Gets details of a chat room from the server.
This is a synchronous method and blocks the current thread.
For the asynchronous method, see asyncFetchChatRoomFromServer(String, EMValueCallBack).
roomId | The chat room ID. |
HyphenateException | A description of the exception. See EMError. |
EMChatRoom com.hyphenate.chat.EMChatRoomManager.fetchChatRoomFromServer | ( | String | roomId, |
boolean | fetchMembers | ||
) | throws HyphenateException |
Gets details of a chat room from the server.
This is a synchronous method and blocks the current thread.
roomId | The chat room ID. |
fetchMembers | Whether to get chat room members. |
HyphenateException | A description of the exception. See EMError. |
EMCursorResult< String > com.hyphenate.chat.EMChatRoomManager.fetchChatRoomMembers | ( | String | chatRoomId, |
String | cursor, | ||
int | pageSize | ||
) | throws HyphenateException |
Gets the chat room member list.
For the asynchronous method, see asyncFetchChatRoomMembers(String, String, int, EMValueCallBack).
This is a synchronous method and blocks the current thread.
chatRoomId | The chat room ID. |
cursor | The cursor position from which to start getting data. At the first call, if you set the cursor as "null", the SDK gets chat room members in the reverse chronological order of when members joined the chat room. |
pageSize | The number of members that you expect to get on each page. The value range is [1,50]. |
HyphenateException | A description of the exception. See EMError. |
EMPageResult< EMChatRoom > com.hyphenate.chat.EMChatRoomManager.fetchPublicChatRoomsFromServer | ( | int | pageNum, |
int | pageSize | ||
) | throws HyphenateException |
Gets chat room data from the server with pagination.
This is a synchronous method and blocks the current thread.
The asynchronous method asyncFetchPublicChatRoomsFromServer(int, int, EMValueCallBack) can be used.
pageNum | The page number, starting from 1. |
pageSize | The number of records that you expect to get on each page. The value range is [1,50]. |
HyphenateException | A description of the exception. See EMError. |
EMChatRoom com.hyphenate.chat.EMChatRoomManager.getChatRoom | ( | String | roomId | ) |
Gets the chat room in the memory.
roomId | The chat room ID. |
void com.hyphenate.chat.EMChatRoomManager.joinChatRoom | ( | final String | roomId, |
boolean | leaveOtherRooms, | ||
String | ext, | ||
final EMValueCallBack< EMChatRoom > | callback | ||
) |
Joins a chat room.
This is an asynchronous method.
roomId | The ID of the chat room to join. |
leaveOtherRooms | Whether to exit other chat rooms. |
ext | Extended information. |
callback | The completion callback. If this call succeeds, calls EMValueCallBack#onSuccess(Object) and returns the chat room object; if this call fails, calls EMValueCallBack#onError(int, String), where the first parameter is the error code and the second is the error message. |
void com.hyphenate.chat.EMChatRoomManager.joinChatRoom | ( | final String | roomId, |
final EMValueCallBack< EMChatRoom > | callback | ||
) |
Joins a chat room.
This is an asynchronous method.
roomId | The ID of the chat room to join. |
callback | The completion callback. If this call succeeds, calls EMValueCallBack#onSuccess(Object) and returns the chat room object; if this call fails, calls EMValueCallBack#onError(int, String), where the first parameter is the error code and the second is the error message. |
void com.hyphenate.chat.EMChatRoomManager.leaveChatRoom | ( | final String | roomId | ) |
Exits a chat room.
This is an asynchronous method.
roomId | The ID of the chat room to exit. |
void com.hyphenate.chat.EMChatRoomManager.leaveChatRoom | ( | final String | roomId, |
EMCallBack | callback | ||
) |
Exits a chat room.
A user that joins a chat room using joinChatRoom(String, EMValueCallBack) can call the leaveChatRoom method to exit the chat room.
This is an asynchronous method.
roomId | The ID of the chat room to exit. |
callback | The completion callback. If this call succeeds, calls EMCallBack#onSuccess(); if this call fails, calls EMCallBack#onError(int, String). |
void com.hyphenate.chat.EMChatRoomManager.removeChatRoomListener | ( | EMChatRoomChangeListener | listener | ) |
Removes the chat room event listener.
listener | The chat room event listener to be removed. |