Chat SDK for Unity and Windows v1.3.0
|
Public Member Functions | |
void | CreateThread (string threadName, string msgId, string groupId, ValueCallBack< ChatThread > callback=null) |
void | JoinThread (string threadId, ValueCallBack< ChatThread > callback=null) |
void | LeaveThread (string threadId, CallBack callback=null) |
void | DestroyThread (string threadId, CallBack callback=null) |
void | RemoveThreadMember (string threadId, string userId, CallBack callback=null) |
void | ChangeThreadName (string threadId, string newName, CallBack callback=null) |
void | FetchThreadMembers (string threadId, string cursor=null, int pageSize=20, ValueCallBack< CursorResult< string > > callback=null) |
void | FetchThreadListOfGroup (string groupId, bool joined, string cursor=null, int pageSize=20, ValueCallBack< CursorResult< ChatThread > > callback=null) |
void | FetchMineJoinedThreadList (string cursor=null, int pageSize=20, ValueCallBack< CursorResult< ChatThread > > callback=null) |
void | GetThreadDetail (string threadId, ValueCallBack< ChatThread > callback=null) |
void | GetLastMessageAccordingThreads (List< string > threadIds, ValueCallBack< Dictionary< string, Message > > callback=null) |
void | AddThreadManagerDelegate (IChatThreadManagerDelegate threadManagerDelegate) |
void | RemoveThreadManagerDelegate (IChatThreadManagerDelegate threadManagerDelegate) |
void AgoraChat.ChatThreadManager.CreateThread | ( | string | threadName, |
string | msgId, | ||
string | groupId, | ||
ValueCallBack< ChatThread > | callback = null |
||
) |
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:
IChatThreadManagerDelegate#OnChatThreadCreate(ChatThreadEvent)
callback. You can listen for message thread events by setting EMChatThreadChangeListener
.IMultiDeviceDelegate#onThreadMultiDevicesEvent(MultiDevicesOperation, String, List)
callback. In this callback method, the first parameter indicates a message thread event, for example, MultiDevicesOperation#THREAD_CREATE
for a message thread creation event. You can listen for message thread events by setting IMultiDeviceDelegate
.threadName | The name of the new message thread. It can contain a maximum of 64 characters. |
msgId | The ID of the parent message. |
groupId | The parent ID, which is the group ID. |
callback | The result callback:
|
void AgoraChat.ChatThreadManager.JoinThread | ( | string | threadId, |
ValueCallBack< ChatThread > | callback = null |
||
) |
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:
IMultiDeviceDelegate#onThreadMultiDevicesEvent(MultiDevicesOperation, String, List)
callback.MultiDevicesOperation#THREAD_JOIN
for a message thread join event.IMultiDeviceDelegate
.threadId | The message thread ID. |
callback | The result callback:
|
void AgoraChat.ChatThreadManager.LeaveThread | ( | string | threadId, |
CallBack | callback = null |
||
) |
Leaves a message thread.
Each member in the message thread can call this method.
In a multi-device login scenario, note the following:
IMultiDeviceDelegate#onThreadMultiDevicesEvent(MultiDevicesOperation, String, List)
callback.MultiDevicesOperation#THREAD_LEAVE
for a message thread leaving event.IMultiDeviceDelegate
.threadId | The ID of the message thread that the current user wants to leave. |
callback | The result callback:
|
void AgoraChat.ChatThreadManager.DestroyThread | ( | string | threadId, |
CallBack | callback = null |
||
) |
Destroys the message thread.
Only the owner or admins of the group where the message thread belongs can call this method.
Note
IMultiDeviceDelegate#onThreadMultiDevicesEvent(MultiDevicesOperation, String, List)
callback. In this callback method, the first parameter indicates a message thread event, for example, MultiDevicesOperation#THREAD_DESTROY
for a message thread destruction event. You can listen for message thread events by setting IMultiDeviceDelegate
.threadId | The message thread ID. |
callback | The result callback:
|
void AgoraChat.ChatThreadManager.RemoveThreadMember | ( | string | threadId, |
string | userId, | ||
CallBack | callback = null |
||
) |
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 IChatThreadManagerDelegate#OnUserKickOutOfChatThread(ChatThreadEvent)
callback.
You can listen for message thread events by setting IChatThreadManagerDelegate
.
threadId | The message thread ID. |
userId | The user ID of the member to be removed from the message thread. |
callback | The result callback.
|
void AgoraChat.ChatThreadManager.ChangeThreadName | ( | string | threadId, |
string | newName, | ||
CallBack | callback = null |
||
) |
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 IChatThreadManagerDelegate#OnChatThreadUpdate(ChatThreadEvent)
callback.
You can listen for message thread events by setting IChatThreadManagerDelegate
.
threadId | The message thread ID. |
newName | The new message thread name. It can contain a maximum of 64 characters. |
callback | The result callback:
|
void AgoraChat.ChatThreadManager.FetchThreadListOfGroup | ( | string | groupId, |
bool | joined, | ||
string | cursor = null , |
||
int | pageSize = 20 , |
||
ValueCallBack< CursorResult< ChatThread > > | callback = null |
||
) |
Use the pagination to get the list of message threads in the specified group.
This method gets data from the server.
groupId | The parent ID, which is the group ID. |
joined | Whether the current user has joined the thread. |
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. |
pageSize | The number of message threads that you expect to get on each page. The value range is [1,50]. |
callBack | The result callback:
|
void AgoraChat.ChatThreadManager.FetchMineJoinedThreadList | ( | string | cursor = null , |
int | pageSize = 20 , |
||
ValueCallBack< CursorResult< ChatThread > > | callback = null |
||
) |
Uses the pagination to get the list of message threads that the current user has joined.
This method gets data from the server.
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. |
pageSize | The number of message threads that you expect to get on each page. The value range is [1,50]. |
callBack | The result callback:
|
void AgoraChat.ChatThreadManager.GetThreadDetail | ( | string | threadId, |
ValueCallBack< ChatThread > | callback = null |
||
) |
Gets the details of the message thread from the server.
threadId | The message thread ID. |
callback | The result callback:
|
void AgoraChat.ChatThreadManager.AddThreadManagerDelegate | ( | IChatThreadManagerDelegate | threadManagerDelegate | ) |
Adds the message thread event listener, which listens for message thread changes, such as the message thread creation and destruction.
You can call RemoveThreadManagerDelegate
to remove an unnecessary message thread event listener.
threadManagerDelegate | The message thread event listener to add. |
void AgoraChat.ChatThreadManager.RemoveThreadManagerDelegate | ( | IChatThreadManagerDelegate | threadManagerDelegate | ) |
Removes the message thread event listener.
After a message thread event listener is added with AddThreadManagerDelegate
, you can call this method to remove it when it is not required.
listener | The message thread event listener to remove. |