hyphenate_SDK4.0 4.8.0
hyphenate java IM SDK
|
Public Member Functions | |
void | addChatThreadChangeListener (EMChatThreadChangeListener listener) |
void | removeChatThreadChangeListener (EMChatThreadChangeListener listener) |
void | createChatThread (String parentId, String messageId, String chatThreadName, EMValueCallBack< EMChatThread > callBack) |
void | getChatThreadFromServer (String chatThreadId, EMValueCallBack< EMChatThread > callBack) |
void | joinChatThread (String chatThreadId, EMValueCallBack< EMChatThread > callBack) |
void | destroyChatThread (String chatThreadId, EMCallBack callBack) |
void | leaveChatThread (String chatThreadId, EMCallBack callBack) |
void | updateChatThreadName (String chatThreadId, String chatThreadName, EMCallBack callBack) |
void | removeMemberFromChatThread (String chatThreadId, String member, EMCallBack callBack) |
void | getChatThreadMembers (String chatThreadId, int limit, String cursor, EMValueCallBack< EMCursorResult< String > > callBack) |
void | getJoinedChatThreadsFromServer (int limit, String cursor, EMValueCallBack< EMCursorResult< EMChatThread > > callBack) |
void | getJoinedChatThreadsFromServer (String parentId, int limit, String cursor, EMValueCallBack< EMCursorResult< EMChatThread > > callBack) |
void | getChatThreadsFromServer (String parentId, int limit, String cursor, EMValueCallBack< EMCursorResult< EMChatThread > > callBack) |
void | getChatThreadLatestMessage (List< String > chatThreadIds, EMValueCallBack< Map< String, EMMessage > > callBack) |
The message thread manager that defines how to manage message threads, including message thread creation, destruction, and member management.
void com.hyphenate.chat.EMChatThreadManager.addChatThreadChangeListener | ( | EMChatThreadChangeListener | listener | ) |
Adds the message thread event listener, which listens for message thread changes, such as the message thread creation and destruction.
You can call removeChatThreadChangeListener(EMChatThreadChangeListener) to remove an unnecessary message thread event listener.
listener | The message thread event listener to add. |
void com.hyphenate.chat.EMChatThreadManager.createChatThread | ( | String | parentId, |
String | messageId, | ||
String | chatThreadName, | ||
EMValueCallBack< EMChatThread > | callBack | ||
) |
Creates a message thread.
Each member of the chat group where the message thread belongs can call this method.
Upon the creation of a message thread, the following will occur:
parentId | The parent ID, which is the group ID. |
messageId | The ID of the parent message. |
chatThreadName | The name of the new message thread. It can contain a maximum of 64 characters. |
callBack | The result callback:
|
void com.hyphenate.chat.EMChatThreadManager.destroyChatThread | ( | String | chatThreadId, |
EMCallBack | callBack | ||
) |
Destroys the message thread.
Only the owner or admins of the group where the message thread belongs can call this method.
Note
chatThreadId | The message thread ID. |
callBack | The result callback:
|
void com.hyphenate.chat.EMChatThreadManager.getChatThreadFromServer | ( | String | chatThreadId, |
EMValueCallBack< EMChatThread > | callBack | ||
) |
Gets the details of the message thread from the server.
chatThreadId | The message thread ID. |
callBack | The result callback:
|
void com.hyphenate.chat.EMChatThreadManager.getChatThreadLatestMessage | ( | List< String > | chatThreadIds, |
EMValueCallBack< Map< String, EMMessage > > | callBack | ||
) |
Gets the last reply in the specified message threads from the server.
chatThreadIds | The list of message thread IDs to query. You can pass a maximum of 20 message thread IDs each time. |
callBack | The result callback:
|
void com.hyphenate.chat.EMChatThreadManager.getChatThreadMembers | ( | String | chatThreadId, |
int | limit, | ||
String | cursor, | ||
EMValueCallBack< EMCursorResult< String > > | callBack | ||
) |
Gets a list of members in the message thread with pagination.
Each member of the group to which the message thread belongs can call this method.
chatThreadId | The message thread ID. |
limit | The number of members that you expect to get on each page. The value range is [1,50]. |
cursor | The position from which to start getting data. At the first method call, if you set cursor to null or an empty string, the SDK will get data in the chronological order of when members join the message thread. |
callBack | The result callback:
|
void com.hyphenate.chat.EMChatThreadManager.getChatThreadsFromServer | ( | String | parentId, |
int | limit, | ||
String | cursor, | ||
EMValueCallBack< EMCursorResult< EMChatThread > > | callBack | ||
) |
Use the pagination to get the list of message threads in the specified group.
This method gets data from the server.
parentId | The parent ID, which is the group ID. |
limit | The number of message threads that you expect to get on each page. The value range is [1,50]. |
cursor | The position from which to start getting data. At the first method call, if you set cursor to null or an empty string, the SDK will get data in the reverse chronological order of when message threads are created. |
callBack | The result callback:
|
void com.hyphenate.chat.EMChatThreadManager.getJoinedChatThreadsFromServer | ( | int | limit, |
String | cursor, | ||
EMValueCallBack< EMCursorResult< EMChatThread > > | callBack | ||
) |
Uses the pagination to get the list of message threads that the current user has joined.
This method gets data from the server.
limit | The number of message threads that you expect to get on each page. The value range is [1,50]. |
cursor | The position from which to start getting data. At the first method call, if you set cursor to null or an empty string, the SDK will get data in the reverse chronological order of when the user joins the message threads. |
callBack | The result callback:
|
void com.hyphenate.chat.EMChatThreadManager.getJoinedChatThreadsFromServer | ( | String | parentId, |
int | limit, | ||
String | cursor, | ||
EMValueCallBack< EMCursorResult< EMChatThread > > | callBack | ||
) |
Use the pagination to get the list of message threads that the current user has joined in the specified group.
This method gets data from the server.
parentId | The parent ID, which is the group ID. |
limit | The number of message threads that you expect to get on each page. The value range is [1,50]. |
cursor | The position from which to start getting data. At the first method call, if you set cursor to null or an empty string, the SDK will get data in the reverse chronological order of when the user joins the message threads. |
callBack | The result callback:
|
void com.hyphenate.chat.EMChatThreadManager.joinChatThread | ( | String | chatThreadId, |
EMValueCallBack< EMChatThread > | callBack | ||
) |
Joins a message thread.
Each member of the group where the message thread belongs can call this method.
In a multi-device login scenario, note the following:
chatThreadId | The message thread ID. |
callBack | The result callback:
|
void com.hyphenate.chat.EMChatThreadManager.leaveChatThread | ( | String | chatThreadId, |
EMCallBack | callBack | ||
) |
Leaves a message thread.
Each member in the message thread can call this method.
In a multi-device login scenario, note the following:
chatThreadId | The ID of the message thread that the current user wants to leave. |
callBack | The result callback:
|
void com.hyphenate.chat.EMChatThreadManager.removeChatThreadChangeListener | ( | EMChatThreadChangeListener | listener | ) |
Removes the message thread event listener.
After a message thread event listener is added with addChatThreadChangeListener(EMChatThreadChangeListener), you can call this method to remove it when it is not required.
listener | The message thread event listener to remove. |
void com.hyphenate.chat.EMChatThreadManager.removeMemberFromChatThread | ( | String | chatThreadId, |
String | member, | ||
EMCallBack | callBack | ||
) |
Removes a member from the message thread.
Only the owner or admins of the group where the message thread belongs and the message thread creator can call this method.
The removed member will receive the EMChatThreadChangeListener#onChatThreadUserRemoved(EMChatThreadEvent) callback.
You can listen for message thread events by setting EMChatThreadChangeListener.
chatThreadId | The message thread ID. |
member | The user ID of the member to be removed from the message thread. |
callBack | The result callback.
|
void com.hyphenate.chat.EMChatThreadManager.updateChatThreadName | ( | String | chatThreadId, |
String | chatThreadName, | ||
EMCallBack | callBack | ||
) |
Changes the name of the message thread.
Only the owner or admins of the group where the message thread belongs and the message thread creator can call this method.
Each member of the group to which the message thread belongs will receive the EMChatThreadChangeListener#onChatThreadUpdated(EMChatThreadEvent) callback.
You can listen for message thread events by setting EMChatThreadChangeListener.
chatThreadId | The message thread ID. |
chatThreadName | The new message thread name. It can contain a maximum of 64 characters. |
callBack | The result callback:
|