agora_chat_SDK
3.8.2
agorajavachatSDK
|
Classes | |
enum | GroupStyle |
Public Member Functions | |
List< Group > | getAllGroups () |
Group | getGroup (String groupId) |
Group | createGroup (String groupName, String desc, String[] allMembers, String reason, GroupOptions option) throws ChatException |
void | asyncCreateGroup (final String groupName, final String desc, final String[] allMembers, final String reason, final GroupOptions option, final ValueCallBack< Group > callback) |
synchronized void | loadAllGroups () |
void | destroyGroup (final String groupId) throws ChatException |
void | asyncDestroyGroup (final String groupId, final CallBack callback) |
void | addUsersToGroup (String groupId, String[] newmembers) throws ChatException |
void | addUsersToGroup (String groupId, String[] newmembers, String welcomeMessage) throws ChatException |
void | asyncAddUsersToGroup (final String groupId, final String[] newmembers, final CallBack callback) |
void | removeUserFromGroup (final String groupId, final String username) throws ChatException |
void | asyncRemoveUserFromGroup (final String groupId, final String username, final CallBack callback) |
void | removeUsersFromGroup (final String groupId, final List< String > members) throws ChatException |
void | asyncRemoveUsersFromGroup (final String groupId, final List< String > members, final CallBack callback) |
void | leaveGroup (String groupId) throws ChatException |
void | asyncLeaveGroup (final String groupId, final CallBack callback) |
Group | getGroupFromServer (String groupId) throws ChatException |
Group | getGroupFromServer (String groupId, boolean fetchMembers) throws ChatException |
void | asyncGetGroupFromServer (final String groupId, final ValueCallBack< Group > callback) |
synchronized List< Group > | getJoinedGroupsFromServer () throws ChatException |
synchronized List< Group > | getJoinedGroupsFromServer (int pageIndex, int pageSize) throws ChatException |
void | asyncGetJoinedGroupsFromServer (final ValueCallBack< List< Group >> callback) |
void | asyncGetJoinedGroupsFromServer (final int pageIndex, final int pageSize, final ValueCallBack< List< Group >> callback) |
CursorResult< GroupInfo > | getPublicGroupsFromServer (int pageSize, String cursor) throws ChatException |
void | asyncGetPublicGroupsFromServer (final int pageSize, final String cursor, final ValueCallBack< CursorResult< GroupInfo >> callback) |
void | joinGroup (String groupId) throws ChatException |
void | asyncJoinGroup (final String groupId, final CallBack callback) |
void | changeGroupName (String groupId, String changedGroupName) throws ChatException |
void | asyncChangeGroupName (final String groupId, final String changedGroupName, final CallBack callback) |
void | changeGroupDescription (String groupId, String changedDescription) throws ChatException |
void | asyncChangeGroupDescription (final String groupId, final String changedDescription, final CallBack callBack) |
Group | acceptInvitation (String groupId, String inviter) throws ChatException |
void | asyncAcceptInvitation (final String groupId, final String inviter, final ValueCallBack< Group > callback) |
void | declineInvitation (String groupId, String inviter, String reason) throws ChatException |
void | asyncDeclineInvitation (final String groupId, final String inviter, final String reason, final CallBack callback) |
void | acceptApplication (String username, String groupId) throws ChatException |
void | asyncAcceptApplication (final String username, final String groupId, final CallBack callback) |
void | declineApplication (String username, String groupId, String reason) throws ChatException |
void | asyncDeclineApplication (final String username, final String groupId, final String reason, final CallBack callback) |
void | inviteUser (String groupId, String[] beInvitedUsernames, String reason) throws ChatException |
void | asyncInviteUser (final String groupId, final String[] beInvitedUsernames, final String reason, final CallBack callback) |
void | applyJoinToGroup (String groupId, String reason) throws ChatException |
void | asyncApplyJoinToGroup (final String groupId, final String reason, final CallBack callback) |
void | blockGroupMessage (String groupId) throws ChatException |
void | asyncBlockGroupMessage (final String groupId, final CallBack callback) |
void | unblockGroupMessage (String groupId) throws ChatException |
void | asyncUnblockGroupMessage (final String groupId, final CallBack callback) |
void | blockUser (String groupId, String username) throws ChatException |
void | asyncBlockUser (final String groupId, final String username, final CallBack callback) |
void | blockUsers (String groupId, List< String > members) throws ChatException |
void | asyncBlockUsers (final String groupId, final List< String > members, final CallBack callback) |
void | unblockUser (String groupId, String username) throws ChatException |
void | asyncUnblockUser (final String groupId, final String username, final CallBack callback) |
void | unblockUsers (String groupId, List< String > members) throws ChatException |
void | asyncUnblockUsers (final String groupId, final List< String > members, final CallBack callback) |
List< String > | getBlockedUsers (String groupId) throws ChatException |
List< String > | getBlockedUsers (String groupId, int pageIndex, int pageSize) throws ChatException |
void | asyncGetBlockedUsers (final String groupId, final ValueCallBack< List< String >> callback) |
void | asyncGetBlockedUsers (final String groupId, final int pageIndex, final int pageSize, final ValueCallBack< List< String >> callback) |
void | addGroupChangeListener (GroupChangeListener listener) |
void | removeGroupChangeListener (GroupChangeListener listener) |
CursorResult< String > | fetchGroupMembers (String groupId, String cursor, int pageSize) throws ChatException |
void | asyncFetchGroupMembers (final String groupId, final String cursor, final int pageSize, final ValueCallBack< CursorResult< String >> callback) |
Group | changeOwner (String groupId, String newOwner) throws ChatException |
void | asyncChangeOwner (final String groupId, final String newOwner, final ValueCallBack< Group > callback) |
Group | addGroupAdmin (final String groupId, final String admin) throws ChatException |
void | asyncAddGroupAdmin (final String groupId, final String admin, final ValueCallBack< Group > callback) |
Group | removeGroupAdmin (String groupId, String admin) throws ChatException |
void | asyncRemoveGroupAdmin (final String groupId, final String admin, final ValueCallBack< Group > callback) |
Group | muteGroupMembers (String groupId, List< String > muteMembers, long duration) throws ChatException |
void | asyncMuteGroupMembers (final String groupId, final List< String > muteMembers, final long duration, final ValueCallBack< Group > callback) |
Group | unMuteGroupMembers (String groupId, List< String > members) throws ChatException |
void | asyncUnMuteGroupMembers (final String groupId, final List< String > members, final ValueCallBack< Group > callback) |
Map< String, Long > | fetchGroupMuteList (String groupId, int pageNum, int pageSize) throws ChatException |
void | asyncFetchGroupMuteList (final String groupId, final int pageNum, final int pageSize, final ValueCallBack< Map< String, Long >> callBack) |
List< String > | fetchGroupBlackList (String groupId, int pageNum, int pageSize) throws ChatException |
void | asyncFetchGroupBlackList (final String groupId, final int pageNum, final int pageSize, final ValueCallBack< List< String >> callBack) |
void | addToGroupWhiteList (final String groupId, final List< String > members, final CallBack callBack) |
void | removeFromGroupWhiteList (final String groupId, final List< String > members, final CallBack callBack) |
void | checkIfInGroupWhiteList (final String groupId, ValueCallBack< Boolean > callBack) |
void | fetchGroupWhiteList (final String groupId, final ValueCallBack< List< String >> callBack) |
void | muteAllMembers (final String groupId, final ValueCallBack< Group > callBack) |
void | unmuteAllMembers (final String groupId, final ValueCallBack< Group > callBack) |
void | updateGroupAnnouncement (String groupId, String announcement) throws ChatException |
void | asyncUpdateGroupAnnouncement (final String groupId, final String announcement, final CallBack callBack) |
String | fetchGroupAnnouncement (String groupId) throws ChatException |
void | asyncFetchGroupAnnouncement (final String groupId, final ValueCallBack< String > callBack) |
MucSharedFile | uploadGroupSharedFile (String groupId, String filePath, CallBack callBack) throws ChatException |
void | asyncUploadGroupSharedFile (final String groupId, final String filePath, final CallBack callBack) |
List< MucSharedFile > | fetchGroupSharedFileList (String groupId, int pageNum, int pageSize) throws ChatException |
void | asyncFetchGroupSharedFileList (final String groupId, final int pageNum, final int pageSize, final ValueCallBack< List< MucSharedFile >> callBack) |
void | deleteGroupSharedFile (String groupId, String fileId) throws ChatException |
void | asyncDeleteGroupSharedFile (final String groupId, final String fileId, final CallBack callBack) |
void | downloadGroupSharedFile (String groupId, String fileId, String savePath, CallBack callBack) throws ChatException |
void | asyncDownloadGroupSharedFile (final String groupId, final String fileId, final String savePath, final CallBack callBack) |
Group | updateGroupExtension (String groupId, String extension) throws ChatException |
Group management is used to manage group creation, deletion, member management and other operations
void io.agora.chat.GroupManager.acceptApplication | ( | String | username, |
String | groupId | ||
) | throws ChatException |
Accept the application of the user to join this group Owner or administrator‘s authority is required Asynchronously method see asyncAcceptApplication(String, String, CallBack)
Synchronization method will block the current thread
username | Application user |
groupId | Group id for application |
Group io.agora.chat.GroupManager.acceptInvitation | ( | String | groupId, |
String | inviter | ||
) | throws ChatException |
Accept group's invitation Asynchronously method see asyncAcceptInvitation(String, String, ValueCallBack)
Synchronization method will block the current thread
groupId | Group ID |
inviter | Inviter |
Group io.agora.chat.GroupManager.addGroupAdmin | ( | final String | groupId, |
final String | admin | ||
) | throws ChatException |
Add group admin Owner‘s authority is required, admin has no authority Asynchronously method see asyncAddGroupAdmin(String, String, ValueCallBack)
Synchronization method will block the current thread
groupId | Group id |
admin | The admin id to add |
void io.agora.chat.GroupManager.addGroupChangeListener | ( | GroupChangeListener | listener | ) |
Register the group change listener After registering, need use removeGroupChangeListener(GroupChangeListener) to unregister
listener | Listener of group event to register |
void io.agora.chat.GroupManager.addToGroupWhiteList | ( | final String | groupId, |
final List< String > | members, | ||
final CallBack | callBack | ||
) |
Add members to whitelist Owner or administrator‘s authority is required
Asynchronously method
groupId | Group id |
members | Member list to add to whitelist |
callBack | Result callback, success call CallBack#onSuccess(), failure call CallBack#onError(int, String) |
void io.agora.chat.GroupManager.addUsersToGroup | ( | String | groupId, |
String[] | newmembers | ||
) | throws ChatException |
Add users to the group Owner or administrator‘s authority is required Asynchronously method see asyncAddUsersToGroup(String, String[], CallBack)
Synchronization method will block the current thread
groupId | Group id |
newmembers | Array of new members to add |
void io.agora.chat.GroupManager.addUsersToGroup | ( | String | groupId, |
String[] | newmembers, | ||
String | welcomeMessage | ||
) | throws ChatException |
Add users to the group Owner or administrator‘s authority is required Asynchronously method see asyncAddUsersToGroup(String, String[], CallBack)
Synchronization method will block the current thread
groupId | Group id |
newmembers | Array of new members to add |
welcomeMessage | welcome message |
void io.agora.chat.GroupManager.applyJoinToGroup | ( | String | groupId, |
String | reason | ||
) | throws ChatException |
Apply to join the group Note: Group style is GroupStyle#GroupStylePublicJoinNeedApproval, which is the public group need to verify Asynchronously method see asyncApplyJoinToGroup(String, String, CallBack)
Synchronization method will block the current thread
groupId | Group id |
reason | Message for join application |
void io.agora.chat.GroupManager.asyncAcceptApplication | ( | final String | username, |
final String | groupId, | ||
final CallBack | callback | ||
) |
Accept the application of the user to join this group Owner or administrator‘s authority is required Synchronization method see acceptApplication(String, String)
Asynchronously method
username | Application user |
groupId | Group id for application |
callback | Result callback, success call CallBack#onSuccess(), failure call CallBack#onError(int, String) |
void io.agora.chat.GroupManager.asyncAcceptInvitation | ( | final String | groupId, |
final String | inviter, | ||
final ValueCallBack< Group > | callback | ||
) |
Accept group's invitation Synchronization method see acceptInvitation(String, String)
Asynchronously method
groupId | Group ID |
inviter | Inviter |
callback | Result callback, success call ValueCallBack#onSuccess(Object), return the updated group instance; Failure call ValueCallBack#onError(int, String) |
void io.agora.chat.GroupManager.asyncAddGroupAdmin | ( | final String | groupId, |
final String | admin, | ||
final ValueCallBack< Group > | callback | ||
) |
Add group admin Owner‘s authority is required, admin has no authority Synchronization method see addGroupAdmin(String, String)
Asynchronously method
groupId | Group id |
admin | New owner id |
callback | Result callback, success call ValueCallBack#onSuccess(Object), return the updated group instance; Failure call ValueCallBack#onError(int, String) |
void io.agora.chat.GroupManager.asyncAddUsersToGroup | ( | final String | groupId, |
final String[] | newmembers, | ||
final CallBack | callback | ||
) |
Add users to the group Owner or administrator‘s authority is required Synchronization method see addUsersToGroup(String, String[])
Asynchronously method
groupId | Group id |
newmembers | Array of new members to add |
callback | Result callback, success call CallBack#onSuccess(), failure call CallBack#onError(int, String) |
void io.agora.chat.GroupManager.asyncApplyJoinToGroup | ( | final String | groupId, |
final String | reason, | ||
final CallBack | callback | ||
) |
Apply to join the group Note: Group style is GroupStyle#GroupStylePublicJoinNeedApproval, which is the public group need to verify Synchronization method see applyJoinToGroup(String, String)
Asynchronously method
groupId | Group id |
reason | Message for join application |
callback | Result callback, success call CallBack#onSuccess(), failure call CallBack#onError(int, String) |
void io.agora.chat.GroupManager.asyncBlockGroupMessage | ( | final String | groupId, |
final CallBack | callback | ||
) |
Set to disable receiving the group messages Current user is still group member, but no longer receives group message Synchronization method see blockGroupMessage(String)
Asynchronously method
groupId | Group id |
callback | Result callback, success call CallBack#onSuccess(), failure call CallBack#onError(int, String) |
void io.agora.chat.GroupManager.asyncBlockUser | ( | final String | groupId, |
final String | username, | ||
final CallBack | callback | ||
) |
Add user to group blacklist Set to block member who can not join group again and will be not allowed to receive any group messages Owner or administrator‘s authority is required Synchronization method see blockUser(String, String)
After v3.3.0: Member who be added to blacklist will be removed to group first, then add to blacklist; The previous version is not the action to remove from group
Asynchronously method
groupId | Group id |
username | User to be blocked |
callback | Result callback, success call CallBack#onSuccess(), failure call CallBack#onError(int, String) |
void io.agora.chat.GroupManager.asyncBlockUsers | ( | final String | groupId, |
final List< String > | members, | ||
final CallBack | callback | ||
) |
Add users to group blacklist Set to block members who can not join group again and will be not allowed to receive any group messages Owner or administrator‘s authority is required Synchronization method see blockUsers(String, List)
After v3.3.0: Members who be added to blacklist will be removed to group first, then add to blacklist; The previous version is not the action to remove from group
Asynchronously method
groupId | Group id |
members | Users to be blocked |
callback | Result callback, success call CallBack#onSuccess(), failure call CallBack#onError(int, String) |
void io.agora.chat.GroupManager.asyncChangeGroupDescription | ( | final String | groupId, |
final String | changedDescription, | ||
final CallBack | callBack | ||
) |
Change group description. ONLY the group own can change group description Owner or administrator‘s authority is required Synchronization method see changeGroupDescription(String, String)
Asynchronously method
groupId | Group id |
changedDescription | Changed group description |
callBack | Result callback, success call CallBack#onSuccess(), failure call CallBack#onError(int, String) |
void io.agora.chat.GroupManager.asyncChangeGroupName | ( | final String | groupId, |
final String | changedGroupName, | ||
final CallBack | callback | ||
) |
Change group name Owner or administrator‘s authority is required Synchronization method see changeGroupName(String, String)
Asynchronously method
groupId | Group id to be change name |
changedGroupName | New group name |
callback | Result callback, success call CallBack#onSuccess(), failure call CallBack#onError(int, String) |
void io.agora.chat.GroupManager.asyncChangeOwner | ( | final String | groupId, |
final String | newOwner, | ||
final ValueCallBack< Group > | callback | ||
) |
Transfer group ownership Owner‘s authority is required Synchronization method see changeOwner(String, String)
Asynchronously method
groupId | Group id |
newOwner | New Owner id |
callback | Result callback, success call ValueCallBack#onSuccess(Object), return the updated group instance; Failure call ValueCallBack#onError(int, String) |
void io.agora.chat.GroupManager.asyncCreateGroup | ( | final String | groupName, |
final String | desc, | ||
final String[] | allMembers, | ||
final String | reason, | ||
final GroupOptions | option, | ||
final ValueCallBack< Group > | callback | ||
) |
Create a group After group is successful created, the data in memory and database will be updated; Multi-device will receive the notification event and then update the data in memory and database. You can set io.agora.MultiDeviceListener to monitor the event, the callback function is io.agora.MultiDeviceListener#onGroupEvent(int, String, List), the first parameter is the event which is io.agora.MultiDeviceListener#GROUP_CREATE
Asynchronously method
groupName | Group name, not necessary, pass null if not set |
desc | Group description, not necessary, pass null if not set |
allMembers | Array of members, no need include the owner of this group, not necessary, not null |
reason | Invitation information when inviting members to join, not necessary, pass null if not set |
option | Options when creating a group, not necessary, not null. See GroupOptions Can set the following parameters: Maximum number of group members, default is 200; Group style, see GroupStyle, default is GroupStyle#GroupStylePrivateOnlyOwnerInvite; If it requires the content of invitee, default is false, invitee will auto join the group; Also can set group ext |
callback | Result callback, success call ValueCallBack#onSuccess(Object), return the Group instance created successful failure call ValueCallBack#onError(int, String) |
void io.agora.chat.GroupManager.asyncDeclineApplication | ( | final String | username, |
final String | groupId, | ||
final String | reason, | ||
final CallBack | callback | ||
) |
Decline the application of the user to join this group Owner or administrator‘s authority is required Synchronization method see declineApplication(String, String, String)
Asynchronously method
username | Application user |
groupId | Group id for application |
reason | Message for decline |
callback | Result callback, success call CallBack#onSuccess(), failure call CallBack#onError(int, String) |
void io.agora.chat.GroupManager.asyncDeclineInvitation | ( | final String | groupId, |
final String | inviter, | ||
final String | reason, | ||
final CallBack | callback | ||
) |
Decline group's invitation Synchronization method see declineInvitation(String, String, String)
Asynchronously method
groupId | Group ID |
inviter | Inviter |
reason | Declining message |
callback | Result callback, success call CallBack#onSuccess(), failure call CallBack#onError(int, String) |
void io.agora.chat.GroupManager.asyncDeleteGroupSharedFile | ( | final String | groupId, |
final String | fileId, | ||
final CallBack | callBack | ||
) |
Delete file from group Members can delete their own uploaded files, and the group owner or group administrator can delete all shared files Synchronization method see deleteGroupSharedFile(String, String)
Asynchronously method
groupId | Group id |
fileId | File id |
callBack | Result callback, success call CallBack#onSuccess(), failure call CallBack#onError(int, String) |
void io.agora.chat.GroupManager.asyncDestroyGroup | ( | final String | groupId, |
final CallBack | callback | ||
) |
Destroy group Owner‘s authority is required Synchronization method see destroyGroup(String)
Asynchronously method
groupId | Group id |
callback | Result callback, success call CallBack#onSuccess(), failure call CallBack#onError(int, String) |
void io.agora.chat.GroupManager.asyncDownloadGroupSharedFile | ( | final String | groupId, |
final String | fileId, | ||
final String | savePath, | ||
final CallBack | callBack | ||
) |
Download the file from group Synchronization method see downloadGroupSharedFile(String, String, String, CallBack)
Asynchronously method
groupId | Group id |
fileId | File id |
savePath | File to saved path |
callBack | Result callback, success call CallBack#onSuccess(), failure call CallBack#onError(int, String) |
void io.agora.chat.GroupManager.asyncFetchGroupAnnouncement | ( | final String | groupId, |
final ValueCallBack< String > | callBack | ||
) |
Get group announcement from server Group member‘s authority is required Synchronization method see fetchGroupAnnouncement(String)
Asynchronously method
groupId | Group id |
callBack | Result callback, success call ValueCallBack#onSuccess(Object), failure call ValueCallBack#onError(int, String) |
void io.agora.chat.GroupManager.asyncFetchGroupBlackList | ( | final String | groupId, |
final int | pageNum, | ||
final int | pageSize, | ||
final ValueCallBack< List< String >> | callBack | ||
) |
Fetch group blacklist from server by page Owner or administrator‘s authority is required Synchronization method see fetchGroupBlackList(String, int, int)
Asynchronously method
groupId | Group id |
pageNum | Page number, start from 1 |
pageSize | Size to be fetched per page |
callBack | Result callback, success call ValueCallBack#onSuccess(Object), return the group blacklist by page; Failure call ValueCallBack#onError(int, String) |
void io.agora.chat.GroupManager.asyncFetchGroupMembers | ( | final String | groupId, |
final String | cursor, | ||
final int | pageSize, | ||
final ValueCallBack< CursorResult< String >> | callback | ||
) |
Get group's member list by page Synchronization method see fetchGroupMembers(String, String, int)
Asynchronously method
groupId | Group id |
cursor | The count fetched a time |
pageSize | The cursor position to fetch data, use null if first call |
callback | Result callback, success call ValueCallBack#onSuccess(Object), fetch result, see CursorResult, used to get next page and the group list, for the last page, CursorResult.getCursor() is an empty string. Failure call ValueCallBack#onError(int, String) |
void io.agora.chat.GroupManager.asyncFetchGroupMuteList | ( | final String | groupId, |
final int | pageNum, | ||
final int | pageSize, | ||
final ValueCallBack< Map< String, Long >> | callBack | ||
) |
Fetch mute list Owner or administrator‘s authority is required Synchronization method see fetchGroupMuteList(String, int, int)
Asynchronously method
groupId | Group id |
pageNum | The count fetched a time |
pageSize | The cursor position to fetch data |
callBack | Result callback, success call ValueCallBack#onSuccess(Object), return a map which contains the mute member id and mute duration, in which the key of each entry is the mute member id and the value is the expired time of banning post action, in milli-seconds; Failure call ValueCallBack#onError(int, String) |
void io.agora.chat.GroupManager.asyncFetchGroupSharedFileList | ( | final String | groupId, |
final int | pageNum, | ||
final int | pageSize, | ||
final ValueCallBack< List< MucSharedFile >> | callBack | ||
) |
Get the shared file list from server Synchronization method see fetchGroupSharedFileList(String, int, int)
Asynchronously method
groupId | Group id |
pageNum | Page number, start from 1 |
pageSize | Size to be fetched per page |
callBack | Result callback, success call ValueCallBack#onSuccess(Object), Return the shared files; Failure call ValueCallBack#onError(int, String) |
void io.agora.chat.GroupManager.asyncGetBlockedUsers | ( | final String | groupId, |
final ValueCallBack< List< String >> | callback | ||
) |
Get blacklist from server, default maximum is 200 Owner or administrator‘s authority is required Synchronization method see getBlockedUsers(String)
Asynchronously method
groupId | Group id |
callback | Result callback, success call ValueCallBack#onSuccess(Object), return the group's blacklist; Failure call ValueCallBack#onError(int, String) |
void io.agora.chat.GroupManager.asyncGetBlockedUsers | ( | final String | groupId, |
final int | pageIndex, | ||
final int | pageSize, | ||
final ValueCallBack< List< String >> | callback | ||
) |
Get black list of group by page Owner or administrator‘s authority is required Synchronization method see getBlockedUsers(String, int, int)
Asynchronously method
groupId | Group id |
pageIndex | Page number, start from 1 |
pageSize | Size to be fetched per page |
callback | Result callback, success call ValueCallBack#onSuccess(Object), return the group's blacklist; Failure call ValueCallBack#onError(int, String) |
void io.agora.chat.GroupManager.asyncGetGroupFromServer | ( | final String | groupId, |
final ValueCallBack< Group > | callback | ||
) |
Get information of group from server Synchronization method see getGroupFromServer(String)
Asynchronously method
groupId | Group id |
callback | Result callback, success call CallBack#onSuccess(), failure call CallBack#onError(int, String) |
void io.agora.chat.GroupManager.asyncGetJoinedGroupsFromServer | ( | final ValueCallBack< List< Group >> | callback | ) |
Fetch all joined groups from server Only return the group list, not include member list in group, use getGroupFromServer(String groupId) if you want it Synchronization method see getJoinedGroupsFromServer()
Asynchronously method
callback | Result callback, success call ValueCallBack#onSuccess(Object), return the group list has joined; failure call ValueCallBack#onError(int, String) |
void io.agora.chat.GroupManager.asyncGetJoinedGroupsFromServer | ( | final int | pageIndex, |
final int | pageSize, | ||
final ValueCallBack< List< Group >> | callback | ||
) |
Fetch joined groups from server by page Only return the group list, not include member list in group getGroupFromServer(String groupId) if you want it Synchronization method see getJoinedGroupsFromServer(int, int)
Asynchronously method
pageIndex | Page number, start from 1 |
pageSize | Size to be fetched per page |
callback | Result callback, success call ValueCallBack#onSuccess(Object), return the group list by page; Failure call ValueCallBack#onError(int, String) |
void io.agora.chat.GroupManager.asyncGetPublicGroupsFromServer | ( | final int | pageSize, |
final String | cursor, | ||
final ValueCallBack< CursorResult< GroupInfo >> | callback | ||
) |
Get public groups from server by page Synchronization method see getPublicGroupsFromServer(int, String)
Asynchronously method
pageSize | The count fetched a time |
cursor | The cursor position to fetch data, use null if first call |
callback | Result callback, success call ValueCallBack#onSuccess(Object), return result, see CursorResult, used to get next page and the group list, for the last page, CursorResult.getCursor() is an empty string; failure call ValueCallBack#onError(int, String) |
void io.agora.chat.GroupManager.asyncInviteUser | ( | final String | groupId, |
final String[] | beInvitedUsernames, | ||
final String | reason, | ||
final CallBack | callback | ||
) |
Invite other users to join the group Note: The group style is GroupStyle#GroupStylePrivateMemberCanInvite, which allow group members to invite users Synchronization method see inviteUser(String, String[], String)
Asynchronously method
groupId | Group id |
beInvitedUsernames | Array of users to be invited |
reason | Message for invitation |
callback | Result callback, success call CallBack#onSuccess(), failure call CallBack#onError(int, String) |
void io.agora.chat.GroupManager.asyncJoinGroup | ( | final String | groupId, |
final CallBack | callback | ||
) |
Join the group by the group id If group's style is GroupStyle#GroupStylePublicOpenJoin,join it not require owner agree; If is GroupStyle#GroupStylePublicJoinNeedApproval, need owner's agreement Synchronization method see joinGroup(String)
Asynchronously method
groupId | Group id |
callback | Result callback, success call CallBack#onSuccess(), failure call CallBack#onError(int, String) |
void io.agora.chat.GroupManager.asyncLeaveGroup | ( | final String | groupId, |
final CallBack | callback | ||
) |
Current joined user exit group
Asynchronously method
groupId | Group id |
callback | Result callback, success call CallBack#onSuccess(), failure call CallBack#onError(int, String) |
void io.agora.chat.GroupManager.asyncMuteGroupMembers | ( | final String | groupId, |
final List< String > | muteMembers, | ||
final long | duration, | ||
final ValueCallBack< Group > | callback | ||
) |
Mute specified members from posting message for specified duration Owner or administrator‘s authority is required Synchronization method see muteGroupMembers(String, List, long)
Asynchronously method
groupId | Group id |
muteMembers | Mute group members |
duration | Mute duration, in milli-seconds |
callback | Result callback, success call ValueCallBack#onSuccess(Object), return the updated group instance; Failure call ValueCallBack#onError(int, String) |
void io.agora.chat.GroupManager.asyncRemoveGroupAdmin | ( | final String | groupId, |
final String | admin, | ||
final ValueCallBack< Group > | callback | ||
) |
Remove group administrator Owner‘s authority is required Synchronization method see removeGroupAdmin(String, String)
Asynchronously method
groupId | Group id |
admin | Admin id to remove |
callback | Result callback, success call ValueCallBack#onSuccess(Object), return the updated group instance; Failure call ValueCallBack#onError(int, String) |
void io.agora.chat.GroupManager.asyncRemoveUserFromGroup | ( | final String | groupId, |
final String | username, | ||
final CallBack | callback | ||
) |
Remove member from group Owner or administrator‘s authority is required Synchronization method see removeUserFromGroup(String, String)
Asynchronously method
groupId | Group id |
username | User id to be removed |
callback | Result callback, success call CallBack#onSuccess(), failure call CallBack#onError(int, String) |
void io.agora.chat.GroupManager.asyncRemoveUsersFromGroup | ( | final String | groupId, |
final List< String > | members, | ||
final CallBack | callback | ||
) |
Remove members from group Owner or administrator‘s authority is required Synchronization method see '
Asynchronously method
groupId | Group id |
members | User ids to be removed |
callback | Result callback, success call CallBack#onSuccess(), failure call CallBack#onError(int, String) |
void io.agora.chat.GroupManager.asyncUnblockGroupMessage | ( | final String | groupId, |
final CallBack | callback | ||
) |
Set to enable to receive the group message again Synchronization method see unblockGroupMessage(String)
Asynchronously method
groupId | Group id |
callback | Result callback, success call CallBack#onSuccess(), failure call CallBack#onError(int, String) |
void io.agora.chat.GroupManager.asyncUnblockUser | ( | final String | groupId, |
final String | username, | ||
final CallBack | callback | ||
) |
Remove the blocked user from the group blacklist Owner or administrator‘s authority is required Synchronization method see unblockUser(String, String)
Asynchronously method
groupId | Group id |
username | Username to remove from blacklist |
callback | Result callback, success call CallBack#onSuccess(), failure call CallBack#onError(int, String) |
void io.agora.chat.GroupManager.asyncUnblockUsers | ( | final String | groupId, |
final List< String > | members, | ||
final CallBack | callback | ||
) |
Remove the blocked users from the group blacklist Owner or administrator‘s authority is required Synchronization method see unblockUsers(String, List)
Asynchronously method
groupId | Group id |
members | The users to remove from blacklist |
callback | Result callback, success call CallBack#onSuccess(), failure call CallBack#onError(int, String) |
void io.agora.chat.GroupManager.asyncUnMuteGroupMembers | ( | final String | groupId, |
final List< String > | members, | ||
final ValueCallBack< Group > | callback | ||
) |
Unban the specified users Owner or administrator‘s authority is required Synchronization method see unMuteGroupMembers(String, List)
Asynchronously method
groupId | Group id |
members | The users to release mute |
callback | Result callback, success call ValueCallBack#onSuccess(Object), return the updated group instance; Failure call ValueCallBack#onError(int, String) |
void io.agora.chat.GroupManager.asyncUpdateGroupAnnouncement | ( | final String | groupId, |
final String | announcement, | ||
final CallBack | callBack | ||
) |
Update group announcement Owner or administrator‘s authority is required Synchronization method see updateGroupAnnouncement(String, String)
Asynchronously method
groupId | Group id |
announcement | Group announcement |
callBack | Result callback, success call CallBack#onSuccess(), failure call CallBack#onError(int, String) |
void io.agora.chat.GroupManager.asyncUploadGroupSharedFile | ( | final String | groupId, |
final String | filePath, | ||
final CallBack | callBack | ||
) |
Upload file to group Synchronization method see uploadGroupSharedFile(String, String, CallBack)
Asynchronously method
groupId | Group id |
filePath | File local path |
callBack | Result callback, success call CallBack#onSuccess(), failure call CallBack#onError(int, String) |
void io.agora.chat.GroupManager.blockGroupMessage | ( | String | groupId | ) | throws ChatException |
Set to disable receiving the group messages Current user is still group member, but no longer receives group message Asynchronously method see asyncBlockGroupMessage(String, CallBack)
Synchronization method will block the current thread
groupId | Group id |
void io.agora.chat.GroupManager.blockUser | ( | String | groupId, |
String | username | ||
) | throws ChatException |
Add user to group blacklist Set to block member who can not join group again and will be not allowed to receive any group messages Owner or administrator‘s authority is required Asynchronously method see asyncBlockUser(String, String, CallBack)
After v3.3.0: Member who be added to blacklist will be removed to group first, then add to blacklist; The previous version is not the action to remove from group
Synchronization method will block the current thread
groupId | Group id |
username | User to be blocked |
void io.agora.chat.GroupManager.blockUsers | ( | String | groupId, |
List< String > | members | ||
) | throws ChatException |
Add users to group blacklist Set to block members who can not join group again and will be not allowed to receive any group messages Owner or administrator‘s authority is required Asynchronously method see asyncBlockUsers(String, List, CallBack)
After v3.3.0: Members who be added to blacklist will be removed to group first, then add to blacklist; The previous version is not the action to remove from group
Synchronization method will block the current thread
groupId | Group Id |
members | Users to be blocked |
void io.agora.chat.GroupManager.changeGroupDescription | ( | String | groupId, |
String | changedDescription | ||
) | throws ChatException |
Change group description Owner or administrator‘s authority is required Asynchronously method see asyncChangeGroupDescription(String, String, CallBack)
Synchronization method will block the current thread
groupId | Group id |
changedDescription | Changed group description |
void io.agora.chat.GroupManager.changeGroupName | ( | String | groupId, |
String | changedGroupName | ||
) | throws ChatException |
Change group name Owner or administrator‘s authority is required Asynchronously method see asyncChangeGroupName(String, String, CallBack)
Synchronization method will block the current thread
groupId | Group id to be change name |
changedGroupName | New group name |
Group io.agora.chat.GroupManager.changeOwner | ( | String | groupId, |
String | newOwner | ||
) | throws ChatException |
Transfer group ownership Owner‘s authority is required Asynchronously method see asyncChangeOwner(String, String, ValueCallBack)
Synchronization method will block the current thread
groupId | Group id |
newOwner | New owner id |
void io.agora.chat.GroupManager.checkIfInGroupWhiteList | ( | final String | groupId, |
ValueCallBack< Boolean > | callBack | ||
) |
Check if current user in group whitelist
Asynchronously method
groupId | Group id |
callBack | Result callback, success call ValueCallBack#onSuccess(Object), return the Boolean whether the current user is in group whitelist; Failure call ValueCallBack#onError(int, String) |
Group io.agora.chat.GroupManager.createGroup | ( | String | groupName, |
String | desc, | ||
String[] | allMembers, | ||
String | reason, | ||
GroupOptions | option | ||
) | throws ChatException |
Create a group After group is successful created, the data in memory and database will be updated; Multi-device will receive the notification event and then update the data in memory and database. You can set io.agora.MultiDeviceListener to monitor the event, the callback function is io.agora.MultiDeviceListener#onGroupEvent(int, String, List), the first parameter is the event which is io.agora.MultiDeviceListener#GROUP_CREATE Asynchronously method see asyncCreateGroup(String, String, String[], String, GroupOptions, ValueCallBack)
Synchronization method will block the current thread
groupName | Group name, not necessary, pass null if not set |
desc | Group description, not necessary, pass null if not set |
allMembers | Array of members, no need include the owner of this group, not necessary, not null |
reason | Invitation information when inviting members to join, not necessary, pass null if not set |
option | Options when creating a group, not necessary, not null. See GroupOptions Can set the following parameters: Maximum number of group members, default is 200; Group style, see GroupStyle, default is GroupStyle#GroupStylePrivateOnlyOwnerInvite; If it requires the content of invitee, default is false, invitee will auto join the group; Also can set group ext |
ChatException | Error info, see io.agora.Error |
void io.agora.chat.GroupManager.declineApplication | ( | String | username, |
String | groupId, | ||
String | reason | ||
) | throws ChatException |
Decline the application of the user to join this group Owner or administrator‘s authority is required Asynchronously method see asyncDeclineApplication(String, String, String, CallBack)
Synchronization method will block the current thread
username | Application user |
groupId | Group id for application |
reason | Message for decline |
void io.agora.chat.GroupManager.declineInvitation | ( | String | groupId, |
String | inviter, | ||
String | reason | ||
) | throws ChatException |
Decline group's invitation Synchronization method see asyncDeclineInvitation(String, String, String, CallBack)
Synchronization method will block the current thread
groupId | Group ID |
inviter | Inviter |
reason | Declining message |
void io.agora.chat.GroupManager.deleteGroupSharedFile | ( | String | groupId, |
String | fileId | ||
) | throws ChatException |
Delete file from group Members can delete their own uploaded files, and the group owner or group administrator can delete all shared files Asynchronously method see asyncDeleteGroupSharedFile(String, String, CallBack)
Synchronization method will block the current thread
groupId | Group id |
fileId | File id |
void io.agora.chat.GroupManager.destroyGroup | ( | final String | groupId | ) | throws ChatException |
Destroy group Owner‘s authority is required Asynchronously method see asyncDestroyGroup(String, CallBack)
Synchronization method will block the current thread
groupId | Group id |
void io.agora.chat.GroupManager.downloadGroupSharedFile | ( | String | groupId, |
String | fileId, | ||
String | savePath, | ||
CallBack | callBack | ||
) | throws ChatException |
Download the file from group Note the callback only callback progress Asynchronously method see asyncDownloadGroupSharedFile(String, String, String, CallBack)
Synchronization method will block the current thread
groupId | Group id |
fileId | File id |
savePath | File to saved path |
callBack | Progress callback to download file |
String io.agora.chat.GroupManager.fetchGroupAnnouncement | ( | String | groupId | ) | throws ChatException |
Get group announcement from server Group member‘s authority is required Asynchronously method see asyncFetchGroupAnnouncement(String, ValueCallBack)
Synchronization method will block the current thread
groupId | Group id |
List<String> io.agora.chat.GroupManager.fetchGroupBlackList | ( | String | groupId, |
int | pageNum, | ||
int | pageSize | ||
) | throws ChatException |
Fetch group blacklist from server by page Owner or administrator‘s authority is required Asynchronously method see asyncFetchGroupBlackList(String, int, int, ValueCallBack)
Synchronization method will block the current thread
groupId | Group id |
pageNum | Page number, start from 1 |
pageSize | Size to be fetched per page |
CursorResult<String> io.agora.chat.GroupManager.fetchGroupMembers | ( | String | groupId, |
String | cursor, | ||
int | pageSize | ||
) | throws ChatException |
Get group's member list by page When CursorResult.getCursor() is an empty string ("") in the result, there is no more data Asynchronously method see asyncFetchGroupMembers(String, String, int, ValueCallBack)
Synchronization method will block the current thread
groupId | Group id |
cursor | The count fetched a time |
pageSize | The cursor position to fetch data, use null if first call |
Map<String, Long> io.agora.chat.GroupManager.fetchGroupMuteList | ( | String | groupId, |
int | pageNum, | ||
int | pageSize | ||
) | throws ChatException |
Fetch mute list Owner or administrator‘s authority is required Asynchronously method see asyncFetchGroupMuteList(String, int, int, ValueCallBack)
Synchronization method will block the current thread
groupId | Group id |
pageNum | The count fetched a time |
pageSize | The cursor position to fetch data |
List<MucSharedFile> io.agora.chat.GroupManager.fetchGroupSharedFileList | ( | String | groupId, |
int | pageNum, | ||
int | pageSize | ||
) | throws ChatException |
Get the shared file list from server Asynchronously method see asyncFetchGroupSharedFileList(String, int, int, ValueCallBack)
Synchronization method will block the current thread
groupId | Group id |
pageNum | Page number, start from 1 |
pageSize | Size to be fetched per page |
void io.agora.chat.GroupManager.fetchGroupWhiteList | ( | final String | groupId, |
final ValueCallBack< List< String >> | callBack | ||
) |
Fetch group whitelist from serer Owner or administrator‘s authority is required
Asynchronously method
groupId | Group id |
callBack | Result callback, success call ValueCallBack#onSuccess(Object), return the group whitelist; Failure call ValueCallBack#onError(int, String) |
List<Group> io.agora.chat.GroupManager.getAllGroups | ( | ) |
Get all groups from cache Before call this method, we suggest that you can call loadAllGroups() at the appropriate time to load the group data from the DB into memory; If have not called loadAllGroups(), this method will load data from database first and then load from cache
List<String> io.agora.chat.GroupManager.getBlockedUsers | ( | String | groupId | ) | throws ChatException |
Fetch black list from server, default maximum is 200 Owner or administrator‘s authority is required Asynchronously method see asyncGetBlockedUsers(String, ValueCallBack)
Synchronization method will block the current thread
groupId | Group id |
List<String> io.agora.chat.GroupManager.getBlockedUsers | ( | String | groupId, |
int | pageIndex, | ||
int | pageSize | ||
) | throws ChatException |
Get blacklist of group from server by page Owner or administrator‘s authority is required Asynchronously method see asyncGetBlockedUsers(String, int, int, ValueCallBack)
Synchronization method will block the current thread
groupId | Group id |
pageIndex | Page number, start from 1 |
pageSize | Size to be fetched per page |
Group io.agora.chat.GroupManager.getGroup | ( | String | groupId | ) |
Group io.agora.chat.GroupManager.getGroupFromServer | ( | String | groupId | ) | throws ChatException |
Get information of group from server Do not get members, use fetchGroupMembers(String, String, int) if want ot get members Asynchronously method see asyncGetGroupFromServer(String, ValueCallBack)
Synchronization method will block the current thread
groupId | Group id |
Group io.agora.chat.GroupManager.getGroupFromServer | ( | String | groupId, |
boolean | fetchMembers | ||
) | throws ChatException |
Get information of group from server When parameter of fetchMembers is true, fetch group members from server, maximum count is 200, if want to get more members, use fetchGroupMembers(String, String, int) Only members in group can get the member list of group
Synchronization method will block the current thread
groupId | Group id |
fetchMembers | Whether need fetch group members, if need fetch members, default action fetch 200 members |
synchronized List<Group> io.agora.chat.GroupManager.getJoinedGroupsFromServer | ( | ) | throws ChatException |
Fetch all joined groups from server Only return the group list, not include member list in group, use getGroupFromServer(String groupId) if you want it Asynchronously method see asyncGetJoinedGroupsFromServer(ValueCallBack)
Synchronization method will block the current thread
synchronized List<Group> io.agora.chat.GroupManager.getJoinedGroupsFromServer | ( | int | pageIndex, |
int | pageSize | ||
) | throws ChatException |
Fetch joined groups from server by page Only return the group list, not include member list in group getGroupFromServer(String groupId) if you want it Asynchronously method see asyncGetJoinedGroupsFromServer(int, int, ValueCallBack)
Synchronization method will block the current thread
pageIndex | Page number, start from 1 |
pageSize | Size to be fetched per page |
CursorResult<GroupInfo> io.agora.chat.GroupManager.getPublicGroupsFromServer | ( | int | pageSize, |
String | cursor | ||
) | throws ChatException |
Get public groups from server by page Asynchronously method see asyncGetPublicGroupsFromServer(int, String, ValueCallBack)
Synchronization method will block the current thread
pageSize | The count fetched a time |
cursor | The cursor position to fetch data, use null if first call |
ChatException | Error code, see io.agora.Error |
void io.agora.chat.GroupManager.inviteUser | ( | String | groupId, |
String[] | beInvitedUsernames, | ||
String | reason | ||
) | throws ChatException |
Invite other users to join the group Note: The group style is GroupStyle#GroupStylePrivateMemberCanInvite, which allow group members to invite users Asynchronously method see asyncInviteUser(String, String[], String, CallBack)
Synchronization method will block the current thread
groupId | Group id |
beInvitedUsernames | Array of users to be invited |
reason | Message for invitation |
void io.agora.chat.GroupManager.joinGroup | ( | String | groupId | ) | throws ChatException |
Join the group by the group id If group's style is GroupStyle#GroupStylePublicOpenJoin,join it not require owner agree; If is GroupStyle#GroupStylePublicJoinNeedApproval, need owner's agreement Asynchronously method see asyncJoinGroup(String, CallBack)
Synchronization method will block the current thread
groupId | Group id |
void io.agora.chat.GroupManager.leaveGroup | ( | String | groupId | ) | throws ChatException |
synchronized void io.agora.chat.GroupManager.loadAllGroups | ( | ) |
load all local groups from database
void io.agora.chat.GroupManager.muteAllMembers | ( | final String | groupId, |
final ValueCallBack< Group > | callBack | ||
) |
Mute all members Owner or administrator‘s authority is required
Asynchronously method
groupId | Group id |
callBack | Result callback, success call ValueCallBack#onSuccess(Object), return the updated group instance; Failure call ValueCallBack#onError(int, String) |
Group io.agora.chat.GroupManager.muteGroupMembers | ( | String | groupId, |
List< String > | muteMembers, | ||
long | duration | ||
) | throws ChatException |
Mute specified members from posting message for specified duration Owner or administrator‘s authority is required Asynchronously method see asyncMuteGroupMembers(String, List, long, ValueCallBack)
Synchronization method will block the current thread
groupId | Group id |
muteMembers | Mute member list |
duration | Mute duration, in milli-seconds |
void io.agora.chat.GroupManager.removeFromGroupWhiteList | ( | final String | groupId, |
final List< String > | members, | ||
final CallBack | callBack | ||
) |
Remove members from whitelist Owner or administrator‘s authority is required
Asynchronously method
groupId | Group id |
members | Member list to add to whitelist |
callBack | Result callback, success call CallBack#onSuccess(), failure call CallBack#onError(int, String) |
Group io.agora.chat.GroupManager.removeGroupAdmin | ( | String | groupId, |
String | admin | ||
) | throws ChatException |
Remove group administrator Owner‘s authority is required Asynchronously method see asyncRemoveGroupAdmin(String, String, ValueCallBack)
Synchronization method will block the current thread
groupId | Group id |
admin | Admin id to remove |
void io.agora.chat.GroupManager.removeGroupChangeListener | ( | GroupChangeListener | listener | ) |
Remove group change listener Use this method after registering addGroupChangeListener(GroupChangeListener)
listener | Listener of group event to unregister |
void io.agora.chat.GroupManager.removeUserFromGroup | ( | final String | groupId, |
final String | username | ||
) | throws ChatException |
Remove member from group Owner or administrator‘s authority is required Asynchronously method see asyncRemoveUserFromGroup(String, String, CallBack)
Synchronization method will block the current thread
groupId | Group id |
username | User id to be removed |
void io.agora.chat.GroupManager.removeUsersFromGroup | ( | final String | groupId, |
final List< String > | members | ||
) | throws ChatException |
Remove members from group Owner or administrator‘s authority is required Asynchronously method see asyncRemoveUsersFromGroup(String, List, CallBack)}
Synchronization method will block the current thread
groupId | Group id |
members | User ids to be removed |
void io.agora.chat.GroupManager.unblockGroupMessage | ( | String | groupId | ) | throws ChatException |
Set to enable to receive the group message again Asynchronously method see asyncUnblockGroupMessage(String, CallBack)
Synchronization method will block the current thread
groupId | Group id |
void io.agora.chat.GroupManager.unblockUser | ( | String | groupId, |
String | username | ||
) | throws ChatException |
Remove the blocked user from the group blacklist Owner or administrator‘s authority is required Asynchronously method see asyncUnblockUser(String, String, CallBack)
Synchronization method will block the current thread
groupId | Group id |
username | Username to remove from blacklist |
void io.agora.chat.GroupManager.unblockUsers | ( | String | groupId, |
List< String > | members | ||
) | throws ChatException |
Remove the blocked users from the group blacklist Owner or administrator‘s authority is required Asynchronously method see asyncBlockUsers(String, List, CallBack)
Synchronization method will block the current thread
groupId | Group id |
members | The users to remove from blacklist |
void io.agora.chat.GroupManager.unmuteAllMembers | ( | final String | groupId, |
final ValueCallBack< Group > | callBack | ||
) |
Release all members muted Owner or administrator‘s authority is required
Asynchronously method
groupId | Group id |
callBack | Result callback, success call ValueCallBack#onSuccess(Object), return the updated group instance; Failure call ValueCallBack#onError(int, String) |
Group io.agora.chat.GroupManager.unMuteGroupMembers | ( | String | groupId, |
List< String > | members | ||
) | throws ChatException |
Unban the specified users Owner or administrator‘s authority is required Asynchronously method see asyncUnMuteGroupMembers(String, List, ValueCallBack)
Synchronization method will block the current thread
groupId | Group id |
members | The users to release mute |
void io.agora.chat.GroupManager.updateGroupAnnouncement | ( | String | groupId, |
String | announcement | ||
) | throws ChatException |
Update group announcement Owner or administrator‘s authority is required Asynchronously method see asyncUpdateGroupAnnouncement(String, String, CallBack)
Synchronization method will block the current thread
Group io.agora.chat.GroupManager.updateGroupExtension | ( | String | groupId, |
String | extension | ||
) | throws ChatException |
MucSharedFile io.agora.chat.GroupManager.uploadGroupSharedFile | ( | String | groupId, |
String | filePath, | ||
CallBack | callBack | ||
) | throws ChatException |
Upload file to group Note: The callback only callback the progress Asynchronously method see asyncUploadGroupSharedFile(String, String, CallBack)
Synchronization method will block the current thread
groupId | group id |
filePath | File local path |
callBack | Progress callback of uploading file |