agora_chat_SDK
3.8.2
agorajavachatSDK
|
Public Member Functions | |
ChatRoomManager (ChatClient client, EMAChatRoomManager manager) | |
void | addChatRoomChangeListener (ChatRoomChangeListener listener) |
void | removeChatRoomChangeListener (ChatRoomChangeListener listener) |
void | removeChatRoomListener (ChatRoomChangeListener listener) |
void | joinChatRoom (final String roomId, final ValueCallBack< ChatRoom > callback) |
void | leaveChatRoom (final String roomId) |
PageResult< ChatRoom > | fetchPublicChatRoomsFromServer (int pageNum, int pageSize) throws ChatException |
CursorResult< ChatRoom > | fetchPublicChatRoomsFromServer (int pageSize, String cursor) throws ChatException |
void | asyncFetchPublicChatRoomsFromServer (final int pageSize, final String cursor, final ValueCallBack< CursorResult< ChatRoom >> callback) |
void | asyncFetchPublicChatRoomsFromServer (final int pageNum, final int pageSize, final ValueCallBack< PageResult< ChatRoom >> callback) |
ChatRoom | fetchChatRoomFromServer (String roomId) throws ChatException |
ChatRoom | fetchChatRoomFromServer (String roomId, boolean fetchMembers) throws ChatException |
void | asyncFetchChatRoomFromServer (final String roomId, final ValueCallBack< ChatRoom > callback) |
ChatRoom | getChatRoom (String roomId) |
List< ChatRoom > | getAllChatRooms () |
ChatRoom | createChatRoom (String subject, String description, String welcomeMessage, int maxUserCount, List< String > members) throws ChatException |
void | asyncCreateChatRoom (final String subject, final String description, final String welcomeMessage, final int maxUserCount, final List< String > members, final ValueCallBack< ChatRoom > callBack) |
void | destroyChatRoom (String chatRoomId) throws ChatException |
void | asyncDestroyChatRoom (final String chatRoomId, final CallBack callBack) |
ChatRoom | changeChatRoomSubject (String chatRoomId, String newSubject) throws ChatException |
void | asyncChangeChatRoomSubject (final String chatRoomId, final String newSubject, final ValueCallBack< ChatRoom > callBack) |
ChatRoom | changeChatroomDescription (String chatRoomId, String newDescription) throws ChatException |
void | asyncChangeChatroomDescription (final String chatRoomId, final String newDescription, final ValueCallBack< ChatRoom > callBack) |
CursorResult< String > | fetchChatRoomMembers (String chatRoomId, String cursor, int pageSize) throws ChatException |
void | asyncFetchChatRoomMembers (final String chatRoomId, final String cursor, final int pageSize, final ValueCallBack< CursorResult< String >> callBack) |
ChatRoom | muteChatRoomMembers (String chatRoomId, List< String > muteMembers, long duration) throws ChatException |
void | asyncMuteChatRoomMembers (final String chatRoomId, final List< String > muteMembers, final long duration, final ValueCallBack< ChatRoom > callBack) |
ChatRoom | unMuteChatRoomMembers (String chatRoomId, List< String > members) throws ChatException |
void | asyncUnMuteChatRoomMembers (final String chatRoomId, final List< String > members, final ValueCallBack< ChatRoom > callBack) |
ChatRoom | changeOwner (String chatRoomId, String newOwner) throws ChatException |
void | asyncChangeOwner (final String chatRoomId, final String newOwner, final ValueCallBack< ChatRoom > callBack) throws ChatException |
ChatRoom | addChatRoomAdmin (String chatRoomId, String admin) throws ChatException |
void | asyncAddChatRoomAdmin (final String chatRoomId, final String admin, final ValueCallBack< ChatRoom > callBack) |
ChatRoom | removeChatRoomAdmin (String chatRoomId, String admin) throws ChatException |
void | asyncRemoveChatRoomAdmin (final String chatRoomId, final String admin, final ValueCallBack< ChatRoom > callBack) |
Map< String, Long > | fetchChatRoomMuteList (String chatRoomId, int pageNum, int pageSize) throws ChatException |
void | asyncFetchChatRoomMuteList (final String chatRoomId, final int pageNum, final int pageSize, final ValueCallBack< Map< String, Long >> callBack) |
ChatRoom | removeChatRoomMembers (String chatRoomId, List< String > members) throws ChatException |
void | asyncRemoveChatRoomMembers (final String chatRoomId, final List< String > members, final ValueCallBack< ChatRoom > callBack) |
ChatRoom | blockChatroomMembers (String chatRoomId, List< String > members) throws ChatException |
void | asyncBlockChatroomMembers (final String chatRoomId, final List< String > members, final ValueCallBack< ChatRoom > callBack) |
ChatRoom | unblockChatRoomMembers (String chatRoomId, List< String > members) throws ChatException |
void | asyncUnBlockChatRoomMembers (final String chatRoomId, final List< String > members, final ValueCallBack< ChatRoom > callBack) |
List< String > | fetchChatRoomBlackList (String chatRoomId, int pageNum, int pageSize) throws ChatException |
void | asyncFetchChatRoomBlackList (final String chatRoomId, final int pageNum, final int pageSize, final ValueCallBack< List< String >> callBack) |
void | addToChatRoomWhiteList (final String chatRoomId, final List< String > members, final ValueCallBack< ChatRoom > callBack) |
void | removeFromChatRoomWhiteList (final String chatRoomId, final List< String > members, final ValueCallBack< ChatRoom > callBack) |
void | checkIfInChatRoomWhiteList (final String chatRoomId, ValueCallBack< Boolean > callBack) |
void | fetchChatRoomWhiteList (final String chatRoomId, final ValueCallBack< List< String >> callBack) |
void | muteAllMembers (final String chatRoomId, final ValueCallBack< ChatRoom > callBack) |
void | unmuteAllMembers (final String chatRoomId, final ValueCallBack< ChatRoom > callBack) |
void | updateChatRoomAnnouncement (String chatRoomId, String announcement) throws ChatException |
void | asyncUpdateChatRoomAnnouncement (final String chatRoomId, final String announcement, final CallBack callBack) |
String | fetchChatRoomAnnouncement (String chatRoomId) throws ChatException |
void | asyncFetchChatRoomAnnouncement (final String chatRoomId, final ValueCallBack< String > callBack) |
Chat room manager, responsible for chat room join, exit, list access and member rights management and so on Such as, join a chat room:
ChatClient.getInstance().chatroomManager().joinChatRoom(conversationId, new ValueCallBack<ChatRoom>() { public void onSuccess(ChatRoom value) { //Do something after successfully joined the chat room } public void onError(int error, String errorMsg) { //Do something after fail to join the chat room } });
ChatRoom io.agora.chat.ChatRoomManager.addChatRoomAdmin | ( | String | chatRoomId, |
String | admin | ||
) | throws ChatException |
Add chat room administrator Owner‘s authority is required Asynchronously method see asyncAddChatRoomAdmin(String, String, ValueCallBack)
Synchronization method will block the current thread
chatRoomId | Chat room id |
admin | Admin id to set |
ChatException | Error info, see io.agora.Error |
void io.agora.chat.ChatRoomManager.addChatRoomChangeListener | ( | ChatRoomChangeListener | listener | ) |
Register chat room change listener Chat room destruction, member entry and exit, silence, whitelisting and so on can be listened by setting ChatRoomChangeListener
After calling this method need to call removeChatRoomListener(ChatRoomChangeListener) at the appropriate time to remove the listener
listener | Chat room listener, see ChatRoomChangeListener |
void io.agora.chat.ChatRoomManager.addToChatRoomWhiteList | ( | final String | chatRoomId, |
final List< String > | members, | ||
final ValueCallBack< ChatRoom > | callBack | ||
) |
Add members to whitelist Owner or administrator‘s authority is required The whitelisted user is not affected when muteAllMembers(String, ValueCallBack) is executed by owner or admins
Asynchronously method
chatRoomId | Chat room id |
members | The member list to add |
callBack | Result callback, success call ValueCallBack#onSuccess(Object), failure call ValueCallBack#onError(int, String) |
void io.agora.chat.ChatRoomManager.asyncAddChatRoomAdmin | ( | final String | chatRoomId, |
final String | admin, | ||
final ValueCallBack< ChatRoom > | callBack | ||
) |
Add chat room administrator Owner‘s authority is required Synchronization method see addChatRoomAdmin(String, String)
Asynchronously method
chatRoomId | Chat room id |
admin | Admin id to set |
callBack | Result callback, success call ValueCallBack#onSuccess(Object), failure call ValueCallBack#onError(int, String) |
void io.agora.chat.ChatRoomManager.asyncBlockChatroomMembers | ( | final String | chatRoomId, |
final List< String > | members, | ||
final ValueCallBack< ChatRoom > | callBack | ||
) |
Add members to chat room's black list Owner or administrator‘s authority is required As member is added to blacklist, have the following behaviors:
1.As member is added to blacklist, will be removed from chat room 2.Call the method ChatRoomChangeListener#onRemovedFromChatRoom(int, String, String, String) to notice, the first parameter is the reason, which is EMAChatRoomManagerListener#BE_KICKED 3.The members have been added to blacklist are barred from rejoining
Synchronization method see blockChatroomMembers(String, List)
Asynchronously method
chatRoomId | Chat room id |
members | The member list to be added to blacklist |
callBack | Result callback, success call ValueCallBack#onSuccess(Object), failure call ValueCallBack#onError(int, String) |
void io.agora.chat.ChatRoomManager.asyncChangeChatroomDescription | ( | final String | chatRoomId, |
final String | newDescription, | ||
final ValueCallBack< ChatRoom > | callBack | ||
) |
Change chat room description Owner‘s authority is required Synchronization method see changeChatroomDescription(String, String)
Asynchronously method
chatRoomId | Chat room id |
newDescription | New description of chat room |
callBack | Result callback, success call ValueCallBack#onSuccess(Object), failure call ValueCallBack#onError(int, String) |
void io.agora.chat.ChatRoomManager.asyncChangeChatRoomSubject | ( | final String | chatRoomId, |
final String | newSubject, | ||
final ValueCallBack< ChatRoom > | callBack | ||
) |
Change chat room subject Owner‘s authority is required Synchronization method see changeChatRoomSubject(String, String)
Asynchronously method
chatRoomId | Chat room id |
newSubject | New name of chat room |
callBack | Result callback, success call ValueCallBack#onSuccess(Object), failure call ValueCallBack#onError(int, String) |
void io.agora.chat.ChatRoomManager.asyncChangeOwner | ( | final String | chatRoomId, |
final String | newOwner, | ||
final ValueCallBack< ChatRoom > | callBack | ||
) | throws ChatException |
Transfer chat room ownership to others Owner‘s authority is required Synchronization method see changeOwner(String, String)
Asynchronously method
chatRoomId | Chat room id |
newOwner | New owner id |
callBack | Result callback, success call ValueCallBack#onSuccess(Object), failure call ValueCallBack#onError(int, String) |
void io.agora.chat.ChatRoomManager.asyncCreateChatRoom | ( | final String | subject, |
final String | description, | ||
final String | welcomeMessage, | ||
final int | maxUserCount, | ||
final List< String > | members, | ||
final ValueCallBack< ChatRoom > | callBack | ||
) |
Create chat room Synchronization method see createChatRoom(String, String, String, int, List)
Asynchronously method
subject | Name of chat room |
description | Description of chat room |
welcomeMessage | Welcome message inviting members to join the chat room |
maxUserCount | Maximum number of members allowed to join |
members | Members inviting to join |
callBack | Result callback, success call ValueCallBack#onSuccess(Object), failure call ValueCallBack#onError(int, String) |
void io.agora.chat.ChatRoomManager.asyncDestroyChatRoom | ( | final String | chatRoomId, |
final CallBack | callBack | ||
) |
Destroy chat room Owner‘s authority is required Synchronization method see destroyChatRoom(String)
Asynchronously method
chatRoomId | Chat room id |
callBack | Result callback, success call CallBack#onSuccess(), failure call CallBack#onError(int, String) |
void io.agora.chat.ChatRoomManager.asyncFetchChatRoomAnnouncement | ( | final String | chatRoomId, |
final ValueCallBack< String > | callBack | ||
) |
Get the chat room announcement from server
chatRoomId | Chat room id |
callBack | Result callback, success call ValueCallBack#onSuccess(Object), return the chat room announcement; failure call ValueCallBack#onError(int, String) |
void io.agora.chat.ChatRoomManager.asyncFetchChatRoomBlackList | ( | final String | chatRoomId, |
final int | pageNum, | ||
final int | pageSize, | ||
final ValueCallBack< List< String >> | callBack | ||
) |
Fetch chat room black list members in pages Owner or administrator‘s authority is required Synchronization method see fetchChatRoomBlackList(String, int, int)
Asynchronously method
chatRoomId | Chat room id |
pageNum | Page number, start from 1 |
pageSize | Size to be fetched per page |
callBack | Result callback, success call ValueCallBack#onSuccess(Object), return the blacklist in chat room; failure call ValueCallBack#onError(int, String) |
void io.agora.chat.ChatRoomManager.asyncFetchChatRoomFromServer | ( | final String | roomId, |
final ValueCallBack< ChatRoom > | callback | ||
) |
Fetch the chat room from server by room id, default not to fetch members Synchronization method see fetchChatRoomFromServer(String)
Asynchronously method
roomId | Chat room id |
callback | Result callback, success call ValueCallBack#onSuccess(Object), failure call ValueCallBack#onError(int, String) |
void io.agora.chat.ChatRoomManager.asyncFetchChatRoomMembers | ( | final String | chatRoomId, |
final String | cursor, | ||
final int | pageSize, | ||
final ValueCallBack< CursorResult< String >> | callBack | ||
) |
Fetch chat room member list When CursorResult.getCursor() is an empty string ("") in the result, there is no more data
Asynchronously method
chatRoomId | Chat room id |
cursor | The cursor position to fetch data |
pageSize | The count fetched a time |
callBack | Result callback, success call ValueCallBack#onSuccess(Object), failure call ValueCallBack#onError(int, String) |
void io.agora.chat.ChatRoomManager.asyncFetchChatRoomMuteList | ( | final String | chatRoomId, |
final int | pageNum, | ||
final int | pageSize, | ||
final ValueCallBack< Map< String, Long >> | callBack | ||
) |
Fetch mute list from server, which contains mute members and mute time Owner or administrator‘s authority is required Synchronization method see fetchChatRoomMuteList(String, int, int)
Asynchronously method
chatRoomId | Chat room id |
pageNum | The count fetched a time |
pageSize | The cursor position to fetch data |
callBack | Result callback, success call ValueCallBack#onSuccess(Object), failure call ValueCallBack#onError(int, String) |
void io.agora.chat.ChatRoomManager.asyncFetchPublicChatRoomsFromServer | ( | final int | pageSize, |
final String | cursor, | ||
final ValueCallBack< CursorResult< ChatRoom >> | callback | ||
) |
Fetch the chat rooms in page When CursorResult.getCursor() is an empty string ("") in the result, there is no more data
Asynchronously method
pageSize | The count fetched a time |
cursor | The cursor position to fetch data |
callback | Result callback, success call ValueCallBack#onSuccess(Object), failure call ValueCallBack#onError(int, String) |
void io.agora.chat.ChatRoomManager.asyncFetchPublicChatRoomsFromServer | ( | final int | pageNum, |
final int | pageSize, | ||
final ValueCallBack< PageResult< ChatRoom >> | callback | ||
) |
Fetch the chat rooms in page
Asynchronously method
pageNum | Page number, start from 1 |
pageSize | Size to be fetched per page |
callback | Result callback, success call ValueCallBack#onSuccess(Object), failure call ValueCallBack#onError(int, String) |
void io.agora.chat.ChatRoomManager.asyncMuteChatRoomMembers | ( | final String | chatRoomId, |
final List< String > | muteMembers, | ||
final long | duration, | ||
final ValueCallBack< ChatRoom > | callBack | ||
) |
Stop members post message for some time Owner or administrator‘s authority is required Synchronization method see muteChatRoomMembers(String, List, long)
Asynchronously method
chatRoomId | Chat room id |
muteMembers | Mute members list |
duration | Mute duration, in milli-seconds |
callBack | Result callback, success call ValueCallBack#onSuccess(Object), failure call ValueCallBack#onError(int, String) |
void io.agora.chat.ChatRoomManager.asyncRemoveChatRoomAdmin | ( | final String | chatRoomId, |
final String | admin, | ||
final ValueCallBack< ChatRoom > | callBack | ||
) |
Remove administrator's authority in chat room Owner‘s authority is required Synchronization method see removeChatRoomAdmin(String, String)
Asynchronously method
chatRoomId | Chat room id |
admin | Admin id to remove |
callBack | Result callback, success call ValueCallBack#onSuccess(Object), failure call ValueCallBack#onError(int, String) |
void io.agora.chat.ChatRoomManager.asyncRemoveChatRoomMembers | ( | final String | chatRoomId, |
final List< String > | members, | ||
final ValueCallBack< ChatRoom > | callBack | ||
) |
Remove chat room members Owner or administrator‘s authority is required Synchronization method see removeChatRoomMembers(String, List)
Asynchronously method
chatRoomId | Chat room id |
members | The members list to be removed |
callBack | Result callback, success call ValueCallBack#onSuccess(Object), failure call ValueCallBack#onError(int, String) |
void io.agora.chat.ChatRoomManager.asyncUnBlockChatRoomMembers | ( | final String | chatRoomId, |
final List< String > | members, | ||
final ValueCallBack< ChatRoom > | callBack | ||
) |
Remove members from chat room's black list Owner or administrator‘s authority is required Synchronization method see unblockChatRoomMembers(String, List)
Asynchronously method
chatRoomId | Chat room id |
members | The members list will be removed from blacklist |
callBack | Result callback, success call ValueCallBack#onSuccess(Object), failure call ValueCallBack#onError(int, String) |
void io.agora.chat.ChatRoomManager.asyncUnMuteChatRoomMembers | ( | final String | chatRoomId, |
final List< String > | members, | ||
final ValueCallBack< ChatRoom > | callBack | ||
) |
Release mute Owner or administrator‘s authority is required Synchronization method see unMuteChatRoomMembers(String, List)
Asynchronously method
chatRoomId | Chat room id |
members | Release mute members list |
callBack | Result callback, success call ValueCallBack#onSuccess(Object), failure call ValueCallBack#onError(int, String) |
void io.agora.chat.ChatRoomManager.asyncUpdateChatRoomAnnouncement | ( | final String | chatRoomId, |
final String | announcement, | ||
final CallBack | callBack | ||
) |
Update chat room announcement Owner or administrator‘s authority is required Synchronization method see updateChatRoomAnnouncement(String, String)
Asynchronously method
chatRoomId | Chat room id |
announcement | Announcement content |
callBack | Result callback, success call CallBack#onSuccess(), failure call CallBack#onError(int, String) |
ChatRoom io.agora.chat.ChatRoomManager.blockChatroomMembers | ( | String | chatRoomId, |
List< String > | members | ||
) | throws ChatException |
Add members to chat room's black list Owner or administrator‘s authority is required As member is added to blacklist, have the following behaviors:
1.As member is added to blacklist, will be removed from chat room 2.Call the method ChatRoomChangeListener#onRemovedFromChatRoom(int, String, String, String) to notice, the first parameter is the reason, which is EMAChatRoomManagerListener#BE_KICKED 3.The members have been added to blacklist are barred from rejoining
Asynchronously method see asyncBlockChatroomMembers(String, List, ValueCallBack)
Synchronization method will block the current thread
chatRoomId | Chat room id |
members | The member list to be added to blacklist |
ChatException | Error info, see io.agora.Error |
ChatRoom io.agora.chat.ChatRoomManager.changeChatroomDescription | ( | String | chatRoomId, |
String | newDescription | ||
) | throws ChatException |
change chat room description Owner‘s authority is required Asynchronously method see asyncChangeChatroomDescription(String, String, ValueCallBack)
Synchronization method will block the current thread
chatRoomId | Chat room id |
newDescription | New description of chat room |
ChatException | Error info, see io.agora.Error |
ChatRoom io.agora.chat.ChatRoomManager.changeChatRoomSubject | ( | String | chatRoomId, |
String | newSubject | ||
) | throws ChatException |
Change chat room subject Owner‘s authority is required Asynchronously method see asyncChangeChatRoomSubject(String, String, ValueCallBack)
Synchronization method will block the current thread
chatRoomId | Chat room id |
newSubject | New name of chat room |
ChatException | Error info, see io.agora.Error |
ChatRoom io.agora.chat.ChatRoomManager.changeOwner | ( | String | chatRoomId, |
String | newOwner | ||
) | throws ChatException |
Transfer chat room ownership to others Owner‘s authority is required Asynchronously method see asyncChangeOwner(String, String, ValueCallBack)
Synchronization method will block the current thread
chatRoomId | Chat room id |
newOwner | New owner id |
ChatException | Error info, see io.agora.Error |
void io.agora.chat.ChatRoomManager.checkIfInChatRoomWhiteList | ( | final String | chatRoomId, |
ValueCallBack< Boolean > | callBack | ||
) |
Check if in whitelist
Asynchronously method
chatRoomId | chat room id |
callBack | Result callback, success call ValueCallBack#onSuccess(Object), return the result if in whitelist failure call ValueCallBack#onError(int, String) |
ChatRoom io.agora.chat.ChatRoomManager.createChatRoom | ( | String | subject, |
String | description, | ||
String | welcomeMessage, | ||
int | maxUserCount, | ||
List< String > | members | ||
) | throws ChatException |
Create chat room
Synchronization method will block the current thread
subject | Name of chat room |
description | Description of chat room |
welcomeMessage | Welcome message inviting members to join the chat room |
maxUserCount | Maximum number of members allowed to join |
members | Members inviting to join |
ChatException | Error info, see io.agora.Error |
void io.agora.chat.ChatRoomManager.destroyChatRoom | ( | String | chatRoomId | ) | throws ChatException |
Destroy chat room Owner‘s authority is required Asynchronously method see asyncDestroyChatRoom(String, CallBack)
Synchronization method will block the current thread
chatRoomId | Chat room id |
ChatException | Error info, see io.agora.Error |
String io.agora.chat.ChatRoomManager.fetchChatRoomAnnouncement | ( | String | chatRoomId | ) | throws ChatException |
Get the chat room announcement from server
chatRoomId | Chat room id |
ChatException | Error info, see io.agora.Error |
List<String> io.agora.chat.ChatRoomManager.fetchChatRoomBlackList | ( | String | chatRoomId, |
int | pageNum, | ||
int | pageSize | ||
) | throws ChatException |
Fetch chat room black list members in pages Owner or administrator‘s authority is required Asynchronously method see asyncFetchChatRoomBlackList(String, int, int, ValueCallBack)
Synchronization method will block the current thread
chatRoomId | Chat room id |
pageNum | Page number, start from 1 |
pageSize | Size to be fetched per page |
ChatException | Error info, see io.agora.Error |
ChatRoom io.agora.chat.ChatRoomManager.fetchChatRoomFromServer | ( | String | roomId | ) | throws ChatException |
Fetch the chat room from server by room id, default not to fetch members Asynchronous method see asyncFetchChatRoomFromServer(String, ValueCallBack)
Synchronization method will block the current thread
roomId | Chat room id |
ChatException | Error code, see io.agora.Error |
ChatRoom io.agora.chat.ChatRoomManager.fetchChatRoomFromServer | ( | String | roomId, |
boolean | fetchMembers | ||
) | throws ChatException |
Fetch the chat room from server by room id. If fetchMembers is true, default maximum of fetched member count is 200, to continue fetch members, call ChatRoomManager#fetchChatRoomMembers(String, String, int)
Synchronization method will block the current thread
roomId | chat room id |
fetchMembers | Whether you need to get chat room members |
ChatException | Error code, see io.agora.Error |
CursorResult<String> io.agora.chat.ChatRoomManager.fetchChatRoomMembers | ( | String | chatRoomId, |
String | cursor, | ||
int | pageSize | ||
) | throws ChatException |
Fetch chat room member list When CursorResult.getCursor() is an empty string ("") in the result, there is no more data As the synchronization method, can use asynchronous method asyncFetchChatRoomMembers(String, String, int, ValueCallBack)
Synchronization method will block the current thread
chatRoomId | Chat room id |
cursor | The cursor position to fetch data |
pageSize | The count fetched a time |
ChatException | Error info, see io.agora.Error |
Map<String, Long> io.agora.chat.ChatRoomManager.fetchChatRoomMuteList | ( | String | chatRoomId, |
int | pageNum, | ||
int | pageSize | ||
) | throws ChatException |
Fetch mute list from server, which contains mute members and mute time Owner or administrator‘s authority is required Asynchronously method see asyncFetchChatRoomMuteList(String, int, int, ValueCallBack)
Synchronization method will block the current thread
chatRoomId | Chat room id |
pageNum | The count fetched a time |
pageSize | The cursor position to fetch data |
ChatException | Error info, see io.agora.Error |
void io.agora.chat.ChatRoomManager.fetchChatRoomWhiteList | ( | final String | chatRoomId, |
final ValueCallBack< List< String >> | callBack | ||
) |
Fetch whitelist from server Owner or administrator‘s authority is required
Asynchronously method
chatRoomId | Chat room id |
callBack | Result callback, success call ValueCallBack#onSuccess(Object), failure call ValueCallBack#onError(int, String) |
PageResult<ChatRoom> io.agora.chat.ChatRoomManager.fetchPublicChatRoomsFromServer | ( | int | pageNum, |
int | pageSize | ||
) | throws ChatException |
Fetch the chat room data in page As the synchronization method, can use asynchronous method asyncFetchPublicChatRoomsFromServer(int, int, ValueCallBack)
Synchronization method will block the current thread
pageNum | Page number, start from 1 |
pageSize | Size to be fetched per page |
ChatException | Error code see io.agora.Error |
CursorResult<ChatRoom> io.agora.chat.ChatRoomManager.fetchPublicChatRoomsFromServer | ( | int | pageSize, |
String | cursor | ||
) | throws ChatException |
Fetch the chat rooms in page When CursorResult.getCursor() is an empty string ("") in the result, there is no more data As the synchronization method, can use asynchronous method asyncFetchPublicChatRoomsFromServer(int, String, ValueCallBack)
Synchronization method will block the current thread
pageSize | The count fetched a time |
cursor | The cursor position to fetch data |
ChatException | Error code, see io.agora.Error |
List<ChatRoom> io.agora.chat.ChatRoomManager.getAllChatRooms | ( | ) |
Get all chat rooms in the cache in ChatRoomManager
ChatRoom io.agora.chat.ChatRoomManager.getChatRoom | ( | String | roomId | ) |
Get the chat room in the cache
roomId | Chat room id |
void io.agora.chat.ChatRoomManager.joinChatRoom | ( | final String | roomId, |
final ValueCallBack< ChatRoom > | callback | ||
) |
Join the chat room Leave chat room call leaveChatRoom(String)
Asynchronously method
roomId | Chat room id to join |
callback | Callback for success or fail. If join chat room success calls ValueCallBack#onSuccess(Object), return the ChatRoom instance; Failed to join chat room calls ValueCallBack#onError(int, String), where the first parameter is the error code, the second is the error message |
void io.agora.chat.ChatRoomManager.leaveChatRoom | ( | final String | roomId | ) |
Leave the chat room After join chat room joinChatRoom(String, ValueCallBack), you need to call this method if want to leave chat room
Asynchronously method
roomId | Chat room id to leave |
void io.agora.chat.ChatRoomManager.muteAllMembers | ( | final String | chatRoomId, |
final ValueCallBack< ChatRoom > | callBack | ||
) |
Mute all members Owner or administrator‘s authority is required Chat room owners, administrators and whitelisted users will not be affected
Asynchronously method
chatRoomId | Chat room id |
callBack | Result callback, success call ValueCallBack#onSuccess(Object), failure call ValueCallBack#onError(int, String) |
ChatRoom io.agora.chat.ChatRoomManager.muteChatRoomMembers | ( | String | chatRoomId, |
List< String > | muteMembers, | ||
long | duration | ||
) | throws ChatException |
Stop members post messages for some time Owner or administrator‘s authority is required Asynchronously method see asyncMuteChatRoomMembers(String, List, long, ValueCallBack)
Synchronization method will block the current thread
chatRoomId | Chat room id |
muteMembers | Mute member list |
duration | Mute duration, in milli-seconds |
ChatException | Error info, see io.agora.Error |
ChatRoom io.agora.chat.ChatRoomManager.removeChatRoomAdmin | ( | String | chatRoomId, |
String | admin | ||
) | throws ChatException |
Remove administrator's authority in chat room Owner‘s authority is required Asynchronously method see asyncRemoveChatRoomAdmin(String, String, ValueCallBack)
Synchronization method will block the current thread
chatRoomId | Chat room id |
admin | Admin id to remove |
ChatException | Error info, see io.agora.Error |
void io.agora.chat.ChatRoomManager.removeChatRoomChangeListener | ( | ChatRoomChangeListener | listener | ) |
Remove chat room change listener After calling addChatRoomChangeListener(ChatRoomChangeListener) can call this method to remove listener, now it is recommended to use removeChatRoomListener(ChatRoomChangeListener) to remove
listener | The chat room listener to be removed |
void io.agora.chat.ChatRoomManager.removeChatRoomListener | ( | ChatRoomChangeListener | listener | ) |
Remove chat room change listener After calling addChatRoomChangeListener(ChatRoomChangeListener) need to call this method to remove listener
listener | The chat room listener to be removed |
ChatRoom io.agora.chat.ChatRoomManager.removeChatRoomMembers | ( | String | chatRoomId, |
List< String > | members | ||
) | throws ChatException |
Remove chat room members Owner or administrator‘s authority is required Asynchronously method see asyncRemoveChatRoomMembers(String, List, ValueCallBack)
Synchronization method will block the current thread
chatRoomId | Chat room id |
members | The members list to be removed |
ChatException | Error info, see io.agora.Error |
void io.agora.chat.ChatRoomManager.removeFromChatRoomWhiteList | ( | final String | chatRoomId, |
final List< String > | members, | ||
final ValueCallBack< ChatRoom > | callBack | ||
) |
Remove members from whitelist Owner or administrator‘s authority is required When members are removed from whitelist, they are affected by muteAllMembers(String, ValueCallBack)
Asynchronously method
chatRoomId | Chat room id |
members | The member list to remove from whitelist |
callBack |
ChatRoom io.agora.chat.ChatRoomManager.unblockChatRoomMembers | ( | String | chatRoomId, |
List< String > | members | ||
) | throws ChatException |
Remove members from chat room's black list Owner or administrator‘s authority is required Asynchronously method see asyncBlockChatroomMembers(String, List, ValueCallBack)
Synchronization method will block the current thread
chatRoomId | Chat room id |
members | The members list will be removed from blacklist |
ChatException | Error info, see io.agora.Error |
void io.agora.chat.ChatRoomManager.unmuteAllMembers | ( | final String | chatRoomId, |
final ValueCallBack< ChatRoom > | callBack | ||
) |
Release the mute status of all members Owner or administrator‘s authority is required
Asynchronously method
chatRoomId | Chat room id |
callBack | Result callback, success call ValueCallBack#onSuccess(Object), failure call ValueCallBack#onError(int, String) |
ChatRoom io.agora.chat.ChatRoomManager.unMuteChatRoomMembers | ( | String | chatRoomId, |
List< String > | members | ||
) | throws ChatException |
Release mute Owner or administrator‘s authority is required Asynchronously method see asyncUnMuteChatRoomMembers(String, List, ValueCallBack)
Synchronization method will block the current thread
chatRoomId | Chat room id |
members | Release mute members list |
ChatException | Error info, see io.agora.Error |
void io.agora.chat.ChatRoomManager.updateChatRoomAnnouncement | ( | String | chatRoomId, |
String | announcement | ||
) | throws ChatException |
Update chat room announcement Owner or administrator‘s authority is required Asynchronously method see asyncUpdateChatRoomAnnouncement(String, String, CallBack)
Synchronization method will block the current thread
chatRoomId | Chat room id |
announcement | Announcement content |
ChatException | Error info, see io.agora.Error |