Chat SDK for Unity and Windows v1.2.0
|
Public Member Functions | |
void | AddRoomAdmin (string roomId, string memberId, CallBack callback=null) |
void | BlockRoomMembers (string roomId, List< string > members, CallBack callback=null) |
void | ChangeRoomOwner (string roomId, string newOwner, CallBack callback=null) |
void | ChangeRoomDescription (string roomId, string newDescription, CallBack callback=null) |
void | ChangeRoomName (string roomId, string newName, CallBack callback=null) |
void | CreateRoom (string name, string descriptions=null, string welcomeMsg=null, int maxUserCount=300, List< string > members=null, ValueCallBack< Room > callback=null) |
void | DestroyRoom (string roomId, CallBack callback=null) |
void | FetchPublicRoomsFromServer (int pageNum=1, int pageSize=200, ValueCallBack< PageResult< Room > > callback=null) |
void | FetchRoomAnnouncement (string roomId, ValueCallBack< string > callback=null) |
void | FetchRoomBlockList (string roomId, int pageNum=1, int pageSize=200, ValueCallBack< List< string > > callback=null) |
void | FetchRoomInfoFromServer (string roomId, ValueCallBack< Room > callback=null) |
void | FetchRoomMembers (string roomId, string cursor="", int pageSize=200, ValueCallBack< CursorResult< string > > callback=null) |
void | FetchRoomMuteList (string roomId, int pageSize=200, int pageNum=1, ValueCallBack< Dictionary< string, long > > callback=null) |
void | JoinRoom (string roomId, ValueCallBack< Room > callback=null) |
void | LeaveRoom (string roomId, CallBack callback=null) |
void | MuteRoomMembers (string roomId, List< string > members, long muteMilliseconds=-1, CallBack callback=null) |
void | RemoveRoomAdmin (string roomId, string adminId, CallBack callback=null) |
void | DeleteRoomMembers (string roomId, List< string > members, CallBack callback=null) |
void | UnBlockRoomMembers (string roomId, List< string > members, CallBack callback=null) |
void | UnMuteRoomMembers (string roomId, List< string > members, CallBack callback=null) |
void | UpdateRoomAnnouncement (string roomId, string announcement, CallBack callback=null) |
void | MuteAllRoomMembers (string roomId, ValueCallBack< Room > callback=null) |
void | UnMuteAllRoomMembers (string roomId, ValueCallBack< Room > callback=null) |
void | AddAllowListMembers (string roomId, List< string > members, CallBack callback=null) |
void | RemoveAllowListMembers (string roomId, List< string > members, CallBack callback=null) |
void | FetchAllowListFromServer (string roomId, ValueCallBack< List< string > > callback=null) |
void | CheckIfInRoomAllowList (string roomId, ValueCallBack< bool > callback=null) |
Room | GetChatRoom (string roomId) |
void | AddAttributes (string roomId, Dictionary< string, string > kv, bool deleteWhenExit=true, bool forced=false, ValueCallBack< Dictionary< string, int > > callback=null) |
void | FetchAttributes (string roomId, List< string > keys=null, ValueCallBack< Dictionary< string, string > > callback=null) |
void | RemoveAttributes (string roomId, List< string > keys, bool forced=false, ValueCallBack< Dictionary< string, int > > callback=null) |
void | AddRoomManagerDelegate (IRoomManagerDelegate roomManagerDelegate) |
void | RemoveRoomManagerDelegate (IRoomManagerDelegate roomManagerDelegate) |
The abstract class for the chat manager.
void AgoraChat.RoomManager.AddRoomAdmin | ( | string | roomId, |
string | memberId, | ||
CallBack | callback = null |
||
) |
Adds a chat room admin.
Only the chat room owner can call this method.
This is an asynchronous method.
chatRoomId | The chat room ID. |
memberId | The user ID of the chat room admin to be added. |
callback | The operation result callback. See CallBack . |
void AgoraChat.RoomManager.BlockRoomMembers | ( | string | roomId, |
List< string > | members, | ||
CallBack | callback = null |
||
) |
Adds members to the block list of the chat room.
Only the chat room owner or admin can call this method.
Note
IRoomManagerDelegate#OnRemovedFromRoom( String, String, String)
callback.This is an asynchronous method.
roomId | The chat room ID. |
members | The list of members to be added to block list of the chat room. |
callback | The operation result callback. See CallBack . |
void AgoraChat.RoomManager.ChangeRoomOwner | ( | string | roomId, |
string | newOwner, | ||
CallBack | callback = null |
||
) |
Transfers the chat room ownership.
Only the chat room owner can call this method.
This is an asynchronous method.
chatRoomId | The chat room ID. |
newOwner | The user ID of the new chat room owner. |
callback | The operation result callback. See CallBack . |
void AgoraChat.RoomManager.ChangeRoomDescription | ( | string | roomId, |
string | newDescription, | ||
CallBack | callback = null |
||
) |
Modifies the chat room description.
Only the chat room owner can call this method.
This is an asynchronous method.
roomId | The chat room ID. |
newDescription | The new description of the chat room. |
callback | The operation result callback. See CallBack . |
void AgoraChat.RoomManager.ChangeRoomName | ( | string | roomId, |
string | newName, | ||
CallBack | callback = null |
||
) |
Changes the chat room name.
Only the chat room owner can call this method.
This is an asynchronous method.
roomId | The chat room ID. |
newName | The new name of the chat room. |
callback | The operation result callback. See CallBack . |
void AgoraChat.RoomManager.CreateRoom | ( | string | name, |
string | descriptions = null , |
||
string | welcomeMsg = null , |
||
int | maxUserCount = 300 , |
||
List< string > | members = null , |
||
ValueCallBack< Room > | callback = null |
||
) |
Creates a chat room.
This is an asynchronous method.
name | The chat room name. |
description | The chat room description. |
welcomeMsg | A welcome message inviting members to join the chat room. |
maxUserCount | The maximum number of members allowed to join the chat room. |
members | The list of members invited to join the chat room. |
callback | The operation result callback. See CallBack . |
void AgoraChat.RoomManager.DestroyRoom | ( | string | roomId, |
CallBack | callback = null |
||
) |
Destroys a chat room.
Only the chat room owner can call this method.
This is an asynchronous method.
roomId | The chat room ID. |
callback | The operation result callback. See CallBack . |
void AgoraChat.RoomManager.FetchPublicRoomsFromServer | ( | int | pageNum = 1 , |
int | pageSize = 200 , |
||
ValueCallBack< PageResult< Room > > | callback = null |
||
) |
Gets chat room data from the server with pagination.
For a large but unknown quantity of data, you can get data with pagination by specifying pageNum
and pageSize
.
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. For the last page, the number of returned records is less than the parameter value. |
callback | The operation result callback. See CallBack . |
void AgoraChat.RoomManager.FetchRoomAnnouncement | ( | string | roomId, |
ValueCallBack< string > | callback = null |
||
) |
Gets the chat room announcement from the server.
This is an asynchronous method.
roomId | The chat room ID. |
callback | The operation result callback. See CallBack . |
void AgoraChat.RoomManager.FetchRoomBlockList | ( | string | roomId, |
int | pageNum = 1 , |
||
int | pageSize = 200 , |
||
ValueCallBack< List< string > > | callback = null |
||
) |
Gets the block list of the chat room with pagination.
For a large but unknown quantity of data, you can get data with pagination by specifying pageSize
and cursor
.
Only the chat room owner or admin can call this method.
This is an asynchronous method.
roomId | The chat room ID. |
pageNum | The page number, starting from 1. |
pageSize | The number of users on the block list that you expect to get on each page. For the last page, the number of returned users is less than the parameter value. |
callback | The operation result callback. See CallBack . |
void AgoraChat.RoomManager.FetchRoomInfoFromServer | ( | string | roomId, |
ValueCallBack< Room > | callback = null |
||
) |
Gets details of a chat room from the server, excluding the member list by default.
This is an asynchronous method.
roomId | The chat room ID. |
callback | The operation callback. If success, the chat room instance is returned; otherwise, an error is returned. See ValueCallBack . |
void AgoraChat.RoomManager.FetchRoomMembers | ( | string | roomId, |
string | cursor = "" , |
||
int | pageSize = 200 , |
||
ValueCallBack< CursorResult< string > > | callback = null |
||
) |
Gets the chat room member list with pagination. For a large but unknown quantity of data, you can get data with pagination by specifying pageSize
and cursor
.
This is an asynchronous method.
roomId | The chat room ID. |
cursor | The cursor position from which to start to get data. At the first method call, if you set cursor as null , the SDK gets the data in the reverse chronological order of when users joined the chat room. Amid the returned data (CursorResult), cursor is a field saved locally and the updated cursor can be passed as the position from which to start to get data for the next query. |
pageSize | The number of members that you expect to get on each page. For the last page, the number of returned members is less than the parameter value. |
callback | The operation callback. If success, the chat room member list is returned; otherwise, an error is returned. See ValueCallBack . |
void AgoraChat.RoomManager.FetchRoomMuteList | ( | string | roomId, |
int | pageSize = 200 , |
||
int | pageNum = 1 , |
||
ValueCallBack< Dictionary< string, long > > | callback = null |
||
) |
Gets the list of members who are muted in the chat room.
For a large but unknown quantity of data, you can get data with pagination by specifying pageSize
and cursor
.
Only the chat room owner or admin can call this method.
This is an asynchronous method.
roomId | The chat room ID. |
pageNum | The page number, starting from 1. |
pageSize | The number of muted members that you expect to get on each page. For the last page, the actual number of returned members is less than the parameter value. |
callback | The operation callback. If success, the chat room mute list is returned; otherwise, an error is returned. See ValueCallBack . |
void AgoraChat.RoomManager.JoinRoom | ( | string | roomId, |
ValueCallBack< Room > | callback = null |
||
) |
Joins the chat room.
To exit the chat room, you can call LeaveRoom(String, CallBack)
.
This is an asynchronous method.
roomId | The ID of the chat room to join. |
callback | The operation callback. If success, the chat room instance is returned; otherwise, an error is returned. See ValueCallBack . |
void AgoraChat.RoomManager.LeaveRoom | ( | string | roomId, |
CallBack | callback = null |
||
) |
Leaves a chat room.
After joining a chat room via JoinRoom(String, ValueCallBack)
, the member can call LeaveRoom
to leave the chat room.
This is an asynchronous method.
roomId | The ID of the chat room to leave. |
callback | The operation callback. See CallBack . |
void AgoraChat.RoomManager.MuteRoomMembers | ( | string | roomId, |
List< string > | members, | ||
long | muteMilliseconds = -1 , |
||
CallBack | callback = null |
||
) |
Mutes members in a chat room.
Only the chat room owner or admin can call this method.
This is an asynchronous method.
roomId | The chat room ID. |
members | The list of members to be muted. |
muteMilliseconds | Muted time duration in millisecond, -1 stand for eternity. |
callback | The operation callback. See CallBack . |
void AgoraChat.RoomManager.RemoveRoomAdmin | ( | string | roomId, |
string | adminId, | ||
CallBack | callback = null |
||
) |
Removes the administrative privileges of a chat room admin.
Only the chat room owner can call this method.
This is an asynchronous method.
roomId | The chat room ID. |
adminId | The user ID of the admin whose administrative privileges are to be removed. |
callback | The operation callback. See CallBack . |
void AgoraChat.RoomManager.DeleteRoomMembers | ( | string | roomId, |
List< string > | members, | ||
CallBack | callback = null |
||
) |
Removes members from a chat room.
Only the chat room owner or admin can call this method.
This is an asynchronous method.
roomId | The chat room ID. |
members | The list of members to be removed from the chat room. |
callback | The operation callback. See CallBack . |
void AgoraChat.RoomManager.UnBlockRoomMembers | ( | string | roomId, |
List< string > | members, | ||
CallBack | callback = null |
||
) |
Removes members from the block list of the chat room.
Only the chat room owner or admin can call this method.
This is an asynchronous method.
roomId | The chat room ID. |
members | The list of members to be removed from the block list of the chat room. |
callback | The operation callback. See CallBack . |
void AgoraChat.RoomManager.UnMuteRoomMembers | ( | string | roomId, |
List< string > | members, | ||
CallBack | callback = null |
||
) |
Unmutes members in a chat room.
Only the chat room owner or admin can call this method.
This is an asynchronous method.
roomId | The chat room ID. |
members | The list of members to be unmuted. |
callback | The operation callback. See CallBack . |
void AgoraChat.RoomManager.UpdateRoomAnnouncement | ( | string | roomId, |
string | announcement, | ||
CallBack | callback = null |
||
) |
Updates the chat room announcement.
Only the chat room owner or admin can call this method.
This is an asynchronous method.
roomId | The chat room ID. |
announcement | The announcement content. |
callback | The operation callback. See CallBack . |
void AgoraChat.RoomManager.MuteAllRoomMembers | ( | string | roomId, |
ValueCallBack< Room > | callback = null |
||
) |
Mutes all members. Only the chat room owner or admin can call this method. This method does not work for the chat room owner, admin, and members added to the allow list.
This is an asynchronous method.
roomId | The chat room ID. |
callback | The completion callback.
|
void AgoraChat.RoomManager.UnMuteAllRoomMembers | ( | string | roomId, |
ValueCallBack< Room > | callback = null |
||
) |
Unmutes all members.
Only the chat room owner or admin can call this method.
This is an asynchronous method.
roomId | The chat room ID. |
callback | The completion callback.
|
void AgoraChat.RoomManager.AddAllowListMembers | ( | string | roomId, |
List< string > | members, | ||
CallBack | callback = null |
||
) |
Adds members to the allow list.
Only the chat room owner or admin can call this method.
A call to the MuteAllMembers
method by the chat room owner or admin does not affect members on the allow list.
This is an asynchronous method.
roomId | The chat room ID. |
members | The list of members to be added to the allow list. |
callback | The completion callback.
|
void AgoraChat.RoomManager.RemoveAllowListMembers | ( | string | roomId, |
List< string > | members, | ||
CallBack | callback = null |
||
) |
Removes members from the block list.
Only the chat room owner or admin can call this method.
When members are removed from the block list, a call to the method MuteAllMembers(String, EMValueCallBack)
will also mute them.
This is an asynchronous method.
roomId | The chat room ID. |
members | The list of members to be removed from the block list. |
callback | The completion callback.
|
void AgoraChat.RoomManager.FetchAllowListFromServer | ( | string | roomId, |
ValueCallBack< List< string > > | callback = null |
||
) |
Gets the chat room allow list from the server.
Only the chat room owner or admin can call this method.
This is an asynchronous method.
chatRoomId | The chat room ID. |
callBack | The completion callback. If this call succeeds, the SDK calls ValueCallBack#OnSuccessValue(Object) ; If this call fails, the SDK calls ValueCallBack#onError(int, String) . |
void AgoraChat.RoomManager.CheckIfInRoomAllowList | ( | string | roomId, |
ValueCallBack< bool > | callback = null |
||
) |
Checks whether the current member is on the chat room block list.
This is an asynchronous method.
roomId | The chat room ID. |
callBack | The completion callback. If this call succeeds, the SDK calls ValueCallBack#OnSuccessValue(Object) to show whether the member is on the block list; if this call fails, the SDK calls ValueCallBack#onError(int, String) . |
Room AgoraChat.RoomManager.GetChatRoom | ( | string | roomId | ) |
Gets the chat room in the memory.
roomId | The chat room ID. |
void AgoraChat.RoomManager.AddAttributes | ( | string | roomId, |
Dictionary< string, string > | kv, | ||
bool | deleteWhenExit = true , |
||
bool | forced = false , |
||
ValueCallBack< Dictionary< string, int > > | callback = null |
||
) |
Sets custom chat room attributes. All members in the chat room owner can call this method.
This is an asynchronous method.
roomId | The chat room ID. |
kv | The chat room attributes to add. The attributes are in key-value format. In a key-value pair, the key is the attribute name that can contain 128 characters at most; the value is the attribute value that cannot exceed 4096 characters. A chat room can have a maximum of 100 custom attributes and the total length of custom chat room attributes cannot exceed 10 GB for each app. Attribute keys support the following character sets:
|
false
: No. @forced Whether to overwrite the attributes with same key set by others.true
: Yes.false
: No. callback | The completion callback. If this call succeeds, the SDK calls ValueCallBack#OnSuccessValue(Dictionary<string, int>) ; if this call fails, the SDK calls CallBackResult#onError(int, String) . |
void AgoraChat.RoomManager.FetchAttributes | ( | string | roomId, |
List< string > | keys = null , |
||
ValueCallBack< Dictionary< string, string > > | callback = null |
||
) |
Gets the list of custom chat room attributes based on the attribute key list.
All members in the chat room owner can call this method.
This is an asynchronous method.
roomId | The chat room ID. |
keys | The key list of attributes to get. If you set it as null or leave it empty, this method retrieves all custom attributes. |
callback | The completion callback. If this call succeeds, the SDK calls ValueCallBack#OnSuccessValue(Dictionary<string, string>) ; if this call fails, the SDK calls ValueCallBack#onError(int, String) . |
void AgoraChat.RoomManager.RemoveAttributes | ( | string | roomId, |
List< string > | keys, | ||
bool | forced = false , |
||
ValueCallBack< Dictionary< string, int > > | callback = null |
||
) |
Removes custom chat room attributes by chat room ID and attribute key list.
All members in the chat room can call this method.
This is an asynchronous method.
roomId | The chat room ID. |
keys | The keys of custom chat room attributes to remove. @forced Whether to remove attributes with same key set by others. |
callback | The completion callback. If this call succeeds, the SDK calls CallBackResult#OnSuccessResult(Dictionary<string, int>) ; if this call fails, the SDK calls CallBackResult#onError(int, String) . |
void AgoraChat.RoomManager.AddRoomManagerDelegate | ( | IRoomManagerDelegate | roomManagerDelegate | ) |
Adds a chat room listener.
roomManagerDelegate | The chat room listener to add. It is inherited from IRoomManagerDelegate . |
void AgoraChat.RoomManager.RemoveRoomManagerDelegate | ( | IRoomManagerDelegate | roomManagerDelegate | ) |
Removes a chat room listener.
roomManagerDelegate | The chat room listener to remove. It is inherited from IRoomManagerDelegate . |