Chat SDK for Android v1.2.1
agora java chat SDK
|
Public Member Functions | |
void | addChatThreadChangeListener (ChatThreadChangeListener listener) |
void | removeChatThreadChangeListener (ChatThreadChangeListener listener) |
void | createChatThread (String parentId, String messageId, String chatThreadName, ValueCallBack< ChatThread > callBack) |
void | getChatThreadFromServer (String chatThreadId, ValueCallBack< ChatThread > callBack) |
void | joinChatThread (String chatThreadId, ValueCallBack< ChatThread > callBack) |
void | destroyChatThread (String chatThreadId, CallBack callBack) |
void | leaveChatThread (String chatThreadId, CallBack callBack) |
void | updateChatThreadName (String chatThreadId, String chatThreadName, CallBack callBack) |
void | removeMemberFromChatThread (String chatThreadId, String member, CallBack callBack) |
void | getChatThreadMembers (String chatThreadId, int limit, String cursor, ValueCallBack< CursorResult< String > > callBack) |
void | getJoinedChatThreadsFromServer (int limit, String cursor, ValueCallBack< CursorResult< ChatThread > > callBack) |
void | getJoinedChatThreadsFromServer (String parentId, int limit, String cursor, ValueCallBack< CursorResult< ChatThread > > callBack) |
void | getChatThreadsFromServer (String parentId, int limit, String cursor, ValueCallBack< CursorResult< ChatThread > > callBack) |
void | getChatThreadLatestMessage (List< String > chatThreadIds, ValueCallBack< Map< String, ChatMessage > > callBack) |
The message thread manager that defines how to manage message threads, including message thread creation, destruction, and member management.
void io.agora.chat.ChatThreadManager.addChatThreadChangeListener | ( | ChatThreadChangeListener | 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(ChatThreadChangeListener) to remove an unnecessary message thread event listener.
listener | The message thread event listener to add. |
void io.agora.chat.ChatThreadManager.createChatThread | ( | String | parentId, |
String | messageId, | ||
String | chatThreadName, | ||
ValueCallBack< ChatThread > | 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 io.agora.chat.ChatThreadManager.destroyChatThread | ( | String | chatThreadId, |
CallBack | 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 io.agora.chat.ChatThreadManager.getChatThreadFromServer | ( | String | chatThreadId, |
ValueCallBack< ChatThread > | callBack | ||
) |
Gets the details of the message thread from the server.
chatThreadId | The message thread ID. |
callBack | The result callback:
|
void io.agora.chat.ChatThreadManager.getChatThreadLatestMessage | ( | List< String > | chatThreadIds, |
ValueCallBack< Map< String, ChatMessage > > | 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 io.agora.chat.ChatThreadManager.getChatThreadMembers | ( | String | chatThreadId, |
int | limit, | ||
String | cursor, | ||
ValueCallBack< CursorResult< 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 io.agora.chat.ChatThreadManager.getChatThreadsFromServer | ( | String | parentId, |
int | limit, | ||
String | cursor, | ||
ValueCallBack< CursorResult< ChatThread > > | 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 io.agora.chat.ChatThreadManager.getJoinedChatThreadsFromServer | ( | int | limit, |
String | cursor, | ||
ValueCallBack< CursorResult< ChatThread > > | 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 io.agora.chat.ChatThreadManager.getJoinedChatThreadsFromServer | ( | String | parentId, |
int | limit, | ||
String | cursor, | ||
ValueCallBack< CursorResult< ChatThread > > | 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 io.agora.chat.ChatThreadManager.joinChatThread | ( | String | chatThreadId, |
ValueCallBack< ChatThread > | 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 io.agora.chat.ChatThreadManager.leaveChatThread | ( | String | chatThreadId, |
CallBack | 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 io.agora.chat.ChatThreadManager.removeChatThreadChangeListener | ( | ChatThreadChangeListener | listener | ) |
Removes the message thread event listener.
After a message thread event listener is added with addChatThreadChangeListener(ChatThreadChangeListener), you can call this method to remove it when it is not required.
listener | The message thread event listener to remove. |
void io.agora.chat.ChatThreadManager.removeMemberFromChatThread | ( | String | chatThreadId, |
String | member, | ||
CallBack | 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 ChatThreadChangeListener#onChatThreadUserRemoved(ChatThreadEvent) callback.
You can listen for message thread events by setting ChatThreadChangeListener.
chatThreadId | The message thread ID. |
member | The user ID of the member to be removed from the message thread. |
callBack | The result callback.
|
void io.agora.chat.ChatThreadManager.updateChatThreadName | ( | String | chatThreadId, |
String | chatThreadName, | ||
CallBack | 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 ChatThreadChangeListener#onChatThreadUpdated(ChatThreadEvent) callback.
You can listen for message thread events by setting ChatThreadChangeListener.
chatThreadId | The message thread ID. |
chatThreadName | The new message thread name. It can contain a maximum of 64 characters. |
callBack | The result callback:
|