Chat SDK for Android v1.3.1
agora java chat SDK
|
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 |
synchronized List< Group > | getJoinedGroupsFromServer (int pageIndex, int pageSize, boolean needMemberCount, boolean needRole) throws ChatException |
void | asyncGetJoinedGroupsFromServer (final ValueCallBack< List< Group > > callback) |
void | asyncGetJoinedGroupsFromServer (final int pageIndex, final int pageSize, final ValueCallBack< List< Group > > callback) |
void | asyncGetJoinedGroupsFromServer (final int pageIndex, final int pageSize, boolean needMemberCount, boolean needRole, final ValueCallBack< List< Group > > callback) |
void | asyncGetJoinedGroupsCountFromServer (final ValueCallBack< Integer > 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) |
void | asyncCheckIfInMuteList (final String groupId, final ValueCallBack< Boolean > 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) |
void | asyncUploadGroupSharedFile (final String groupId, final String filePath, final ValueCallBack< MucSharedFile > 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) |
void | asyncSetGroupMemberAttributes (String groupId, String userId, Map< String, String > attributeMap, CallBack callBack) |
void | asyncFetchGroupMemberAllAttributes (String groupId, String userId, ValueCallBack< Map< String, Map< String, String > > > callBack) |
void | asyncFetchGroupMembersAttributes (String groupId, List< String > userList, List< String > keyList, ValueCallBack< Map< String, Map< String, String > > > callBack) |
Group | updateGroupExtension (String groupId, String extension) throws ChatException |
void | cleanAllGroupsFromLocal () |
The group manager for management of group creation and deletion and member management.
void io.agora.chat.GroupManager.acceptApplication | ( | String | username, |
String | groupId | ||
) | throws ChatException |
Approves a group request.
Only the group owner or admin can call this method.
For the asynchronous method, see asyncAcceptApplication(String, String, CallBack).
This is a synchronous method and blocks the current thread.
username | The ID of the user who sends a request to join the group. |
groupId | The group ID. |
ChatException | A description of the exception. See Error. |
Group io.agora.chat.GroupManager.acceptInvitation | ( | String | groupId, |
String | inviter | ||
) | throws ChatException |
Accepts a group invitation.
For the asynchronous method, see asyncAcceptInvitation(String, String, ValueCallBack)。
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
inviter | The user who initiates the invitation. |
ChatException | A description of the exception. see Error. |
Group io.agora.chat.GroupManager.addGroupAdmin | ( | final String | groupId, |
final String | admin | ||
) | throws ChatException |
Adds a group admin. Only the group owner can call this method and admin can not. For the asynchronous method, see asyncAddGroupAdmin(String, String, ValueCallBack).
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
admin | The admin ID to add. |
ChatException | A description of the exception. See Error. |
void io.agora.chat.GroupManager.addGroupChangeListener | ( | GroupChangeListener | listener | ) |
Registers a group change listener. The registered listener needs to be used together with removeGroupChangeListener(GroupChangeListener).
listener | The group event listener to be registered. |
void io.agora.chat.GroupManager.addToGroupWhiteList | ( | final String | groupId, |
final List< String > | members, | ||
final CallBack | callBack | ||
) |
Adds members to the allowlist. Only the group owner or admin can call this method.
This is an asynchronous method.
groupId | The group ID. |
members | The members to be added to the allowlist. |
callBack | The completion callback. If this call succeeds, calls CallBack#onSuccess(); if this call fails, calls CallBack#onError(int, String). |
void io.agora.chat.GroupManager.addUsersToGroup | ( | String | groupId, |
String[] | newmembers | ||
) | throws ChatException |
Adds users to the group. Only the group creator or admin can call this method. For the asynchronous method, see asyncAddUsersToGroup(String, String[], CallBack).
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
newmembers | The array of new members to add. |
ChatException | A description of the exception. See Error. |
void io.agora.chat.GroupManager.addUsersToGroup | ( | String | groupId, |
String[] | newmembers, | ||
String | welcomeMessage | ||
) | throws ChatException |
Adds users to the group. Only the group owner or admin can call this method. For the asynchronous method, see asyncAddUsersToGroup(String, String[], CallBack).
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
newmembers | The array of new members to add. |
welcomeMessage | The welcome message. |
ChatException | A description of the exception. See Error. |
void io.agora.chat.GroupManager.applyJoinToGroup | ( | String | groupId, |
String | reason | ||
) | throws ChatException |
Requests to join a group. Note: The group style is GroupStyle#GroupStylePublicJoinNeedApproval, which is a public group requiring authentication. For an asynchronous method, see asyncApplyJoinToGroup(String, String, CallBack).
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
reason | The reason for requesting to join the group. |
ChatException | A description of the exception. See Error. |
void io.agora.chat.GroupManager.asyncAcceptApplication | ( | final String | username, |
final String | groupId, | ||
final CallBack | callback | ||
) |
Approves a group request.
Only the group owner or admin can call this method.
For the synchronous method, see acceptApplication(String, String).
This is an asynchronous method.
username | The ID of the user who sends the request to join the group. |
groupId | The group ID. |
callback | The completion callback. If this call succeeds, calls CallBack#onSuccess(); if this call fails, calls CallBack#onError(int, String) if it does not. |
void io.agora.chat.GroupManager.asyncAcceptInvitation | ( | final String | groupId, |
final String | inviter, | ||
final ValueCallBack< Group > | callback | ||
) |
Accepts a group invitation.
For the synchronous method, see acceptInvitation(String, String).
This is an asynchronous method.
groupId | The group ID. |
inviter | The inviter ID. |
callback | The completion callback. If this call succeeds, calls ValueCallBack#onSuccess(Object) and returns the updated group instance; if this call fails, calls ValueCallBack#onError(int, String). |
void io.agora.chat.GroupManager.asyncAddGroupAdmin | ( | final String | groupId, |
final String | admin, | ||
final ValueCallBack< Group > | callback | ||
) |
Adds a group admin. Only the group owner can call this method and admin can not. For the synchronous method, see addGroupAdmin(String, String)
This is an asynchronous method.
groupId | The group ID. |
admin | The new owner ID. |
callback | The completion callback. If this call succeeds, calls ValueCallBack#onSuccess(Object) and returns the updated group instance; If this call fails, calls ValueCallBack#onError(int, String). |
void io.agora.chat.GroupManager.asyncAddUsersToGroup | ( | final String | groupId, |
final String[] | newmembers, | ||
final CallBack | callback | ||
) |
Adds users to the group. Only the group owner or admin can call this method. For the synchronous method, see addUsersToGroup(String, String[]).
This is an asynchronous method.
groupId | The group ID. |
newmembers | The array of new members to add. |
callback | The completion callback. If this call succeeds, calls CallBack#onSuccess(); If this call fails, calls CallBack#onError(int, String). |
void io.agora.chat.GroupManager.asyncApplyJoinToGroup | ( | final String | groupId, |
final String | reason, | ||
final CallBack | callback | ||
) |
Requests to join a group. Note: The group style is GroupStyle#GroupStylePublicJoinNeedApproval, which is a public group requiring authentication. For the synchronous method, see applyJoinToGroup(String, String).
This is an asynchronous method.
groupId | The group ID. |
reason | The reason for requesting to joining the group. |
callback | The completion callback. If this call succeeds, calls CallBack#onSuccess(); if this call fails, calls CallBack#onError(int, String). |
void io.agora.chat.GroupManager.asyncBlockGroupMessage | ( | final String | groupId, |
final CallBack | callback | ||
) |
Blocks group messages. The user that blocks group messages is still a group member, but can't receive group messages. For the synchronous method, see blockGroupMessage(String).
This is an asynchronous method.
groupId | The group ID. |
callback | The completion callback. If this call succeeds, calls CallBack#onSuccess(); if this call fails, calls CallBack#onError(int, String). |
void io.agora.chat.GroupManager.asyncBlockUser | ( | final String | groupId, |
final String | username, | ||
final CallBack | callback | ||
) |
Adds the user to the group blocklist. Users will be first removed from the group they have joined before being added to the group blocklist. The users on the group blocklist can not join the group again. Only the group owner or admin can call this method. For the synchronous method, see blockUser(String, String).
This is an asynchronous method.
groupId | The group ID. |
username | The user to be added to the blocklist. |
callback | The completion callback. If this call succeeds, calls CallBack#onSuccess(); If this call fails, calls CallBack#onError(int, String). |
void io.agora.chat.GroupManager.asyncBlockUsers | ( | final String | groupId, |
final List< String > | members, | ||
final CallBack | callback | ||
) |
Adds the user to the group blocklist. Users will be first removed from the group they have joined before being added to the group blocklist. The users on the group blocklist can not join the group again. Only the group owner or admin can call this method. For the synchronous method, see blockUsers(String, List).
This is an asynchronous method.
groupId | The group ID. |
members | The list of users to be blocked. |
callback | The completion callback. If this call succeeds, calls CallBack#onSuccess(); if this call fails, calls CallBack#onError(int, String). |
void io.agora.chat.GroupManager.asyncChangeGroupDescription | ( | final String | groupId, |
final String | changedDescription, | ||
final CallBack | callBack | ||
) |
Changes the group description.
Only the group owner or admin can call this method.
For the synchronous method, see changeGroupDescription(String, String).
This is an asynchronous method.
groupId | The group ID. |
changedDescription | The new group description. |
callBack | The completion callback. If this call succeeds, calls CallBack#onSuccess(); if this call fails, calls CallBack#onError(int, String). |
void io.agora.chat.GroupManager.asyncChangeGroupName | ( | final String | groupId, |
final String | changedGroupName, | ||
final CallBack | callback | ||
) |
Changes the group name.
Only the group owner or admin can call this method.
For the synchronous method, see changeGroupName(String, String).
This is an asynchronous method.
groupId | The ID of group whose name is to be changed. |
changedGroupName | The new group name. |
callback | The completion callback. If this call succeeds, calls CallBack#onSuccess(); if this call fails, calls CallBack#onError(int, String). |
void io.agora.chat.GroupManager.asyncChangeOwner | ( | final String | groupId, |
final String | newOwner, | ||
final ValueCallBack< Group > | callback | ||
) |
Transfers the group ownership. Only the group owner can call this method. For the synchronous method, see changeOwner(String, String)。
This is an asynchronous method.
groupId | The group ID. |
newOwner | The new owner ID. |
callback | The completion callback. If this call succeeds, calls ValueCallBack#onSuccess(Object) and returns the updated group instance; if this call fails, calls ValueCallBack#onError(int, String). |
void io.agora.chat.GroupManager.asyncCheckIfInMuteList | ( | final String | groupId, |
final ValueCallBack< Boolean > | callBack | ||
) |
Checks whether the current member is muted or not.
This is an asynchronous method.
groupId | The group ID. |
callBack | The completion callback. If this call succeeds, calls ValueCallBack#onSuccess(Object) to show whether the member is be muted or not; if this call fails, calls 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 | ||
) |
Creates a group instance. After the group is created, the data in the cache and database will be updated and multiple devices will receive the notification event and update the group to the cache and database. You can set io.agora.MultiDeviceListener to listen on the event. The event callback function is io.agora.MultiDeviceListener#onGroupEvent(int, String, List), where the first parameter is the event, for example, io.agora.MultiDeviceListener#GROUP_CREATE for the group creation event.
This is an asynchronous method.
groupName | The group name. It is optional. Pass null if you do not want to set this parameter. |
desc | The group description. It is optional. Pass null if you do not want to set this parameter. |
allMembers | The group member array. The group owner ID is optional. This parameter can not be null. |
reason | The group joining invitation. It is optional. Pass null if you do not want to set this parameter. |
option | The options for creating a group. They are optional and can not be null. See GroupOptions. The options are as follows:
|
callback | The completion callback. If this call succeeds, calls ValueCallBack#onSuccess(Object) and returns the created group object; If this call fails, calls ValueCallBack#onError(int, String). |
void io.agora.chat.GroupManager.asyncDeclineApplication | ( | final String | username, |
final String | groupId, | ||
final String | reason, | ||
final CallBack | callback | ||
) |
Declines a group request. Only the group owner or admin can call this method. For the synchronous method, see declineApplication(String, String, String).
This is an asynchronous method.
username | The ID of the user who sends the request to join the group. |
groupId | The group ID. |
reason | The reason of declining. |
callback | The completion callback. If this call succeeds, calls CallBack#onSuccess(); if this call fails, calls CallBack#onError(int, String). |
void io.agora.chat.GroupManager.asyncDeclineInvitation | ( | final String | groupId, |
final String | inviter, | ||
final String | reason, | ||
final CallBack | callback | ||
) |
Declines a group invitation. For the synchronous method, see declineInvitation(String, String, String).
This is an asynchronous method.
groupId | The group ID. |
inviter | The inviter ID. |
reason | The reason for declining. |
callback | The completion callback. If this call succeeds, calls CallBack#onSuccess(); if this call fails, calls CallBack#onError(int, String). |
void io.agora.chat.GroupManager.asyncDeleteGroupSharedFile | ( | final String | groupId, |
final String | fileId, | ||
final CallBack | callBack | ||
) |
Removes the shared file of the group. Group members can delete their own uploaded files. The group owner or admin can delete all shared files. For the synchronous method, see deleteGroupSharedFile(String, String).
This is an asynchronous method.
groupId | The group ID. |
fileId | The shared file ID. |
callBack | The completion callback. If this call succeeds, calls CallBack#onSuccess(); if this call fails, calls CallBack#onError(int, String). |
void io.agora.chat.GroupManager.asyncDestroyGroup | ( | final String | groupId, |
final CallBack | callback | ||
) |
Destroys the group instance. Only the group owner can call this method. For the synchronous method, see destroyGroup(String).
This is an asynchronous method.
groupId | The group ID. |
callback | The completion callback. If this call succeeds, calls CallBack#onSuccess(); if this call fails, calls CallBack#onError(int, String). |
void io.agora.chat.GroupManager.asyncDownloadGroupSharedFile | ( | final String | groupId, |
final String | fileId, | ||
final String | savePath, | ||
final CallBack | callBack | ||
) |
Downloads the shared file of the group. For synchronous method, see downloadGroupSharedFile(String, String, String, CallBack).
This is an asynchronous method.
groupId | The group ID. |
fileId | The shared file ID. |
savePath | The file path. |
callBack | The completion callback. If this call succeeds, calls CallBack#onSuccess(); if this call fails, calls CallBack#onError(int, String). Calls CallBack#onProgress(int, String) to view the file download progress. |
void io.agora.chat.GroupManager.asyncFetchGroupAnnouncement | ( | final String | groupId, |
final ValueCallBack< String > | callBack | ||
) |
Gets the group announcement from the server. Group members can call this method. For the synchronous method, see fetchGroupAnnouncement(String).
This is an asynchronous method.
groupId | The group ID. |
callBack | The completion callback. If this call succeeds, calls ValueCallBack#onSuccess(Object); if this call fails, calls ValueCallBack#onError(int, String). |
void io.agora.chat.GroupManager.asyncFetchGroupBlackList | ( | final String | groupId, |
final int | pageNum, | ||
final int | pageSize, | ||
final ValueCallBack< List< String > > | callBack | ||
) |
Gets the blocklist of group from the server with pagination. Only the group owner or admin can call this method. For the synchronous method, see fetchGroupBlackList(String, int, int).
This is an asynchronous method.
groupId | The group ID. |
pageNum | The page number, starting from 1. |
pageSize | The number of users on the blocklist per page. |
callBack | The completion callback. If this call succeeds, calls ValueCallBack#onSuccess(Object) and returns the group blocklist on the next page; if this call fails, calls ValueCallBack#onError(int, String). |
void io.agora.chat.GroupManager.asyncFetchGroupMemberAllAttributes | ( | String | groupId, |
String | userId, | ||
ValueCallBack< Map< String, Map< String, String > > > | callBack | ||
) |
Gets all custom attributes of a group member.
groupId | The group ID. |
userId | The user ID of the group member whose all custom attributes are retrieved. |
callBack | The completion callback. If this call succeeds, calls ValueCallBack#onSuccess(Object); if this call fails, calls ValueCallBack#onError(int, String). |
void io.agora.chat.GroupManager.asyncFetchGroupMembers | ( | final String | groupId, |
final String | cursor, | ||
final int | pageSize, | ||
final ValueCallBack< CursorResult< String > > | callback | ||
) |
Gets a group's member list with pagination. For the synchronous method, see fetchGroupMembers(String, String, int).
This is an asynchronous method.
groupId | The group ID. |
cursor | The cursor position from which to start to get data next time. Sets the parameter as null for the first time. |
pageSize | The number of group members per page. |
callback | The completion callback. If this call succeeds, calls ValueCallBack#onSuccess(Object) and returns the result of CursorResult, including the cursor for getting data next time and the group member list. For the last page, the return value of cursor is an empty string. If this call fails, calls ValueCallBack#onError(int, String). |
void io.agora.chat.GroupManager.asyncFetchGroupMembersAttributes | ( | String | groupId, |
List< String > | userList, | ||
List< String > | keyList, | ||
ValueCallBack< Map< String, Map< String, String > > > | callBack | ||
) |
Gets custom attributes of multiple group members by attribute key.
groupId | The group ID. |
userList | The array of user IDs of group members whose custom attributes are retrieved. |
keyList | The array of keys of custom attributes to be retrieved. If you pass in an empty array or do not set this parameter, the SDK gets all custom attributes of these group members. |
callBack | The completion callback. If this call succeeds, calls ValueCallBack#onSuccess(Object); if this call fails, calls 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 | ||
) |
Gets the mutelist of the group from the server. Only the group owner or admin can call this method. For the asynchronous method, see fetchGroupMuteList(String, int, int).
This is an asynchronous method.
groupId | The group ID. |
pageNum | The page number, starting from 1. |
pageSize | The number of muted members per page. |
callBack | The completion callback. If this call succeeds, calls ValueCallBack#onSuccess(Object) and The map which contains the muted member ID and mute duration, where the key of each entry is the ID of a muted member and the value is the mute duration in milliseconds. If this call fails, calls ValueCallBack#onError(int, String). |
void io.agora.chat.GroupManager.asyncFetchGroupSharedFileList | ( | final String | groupId, |
final int | pageNum, | ||
final int | pageSize, | ||
final ValueCallBack< List< MucSharedFile > > | callBack | ||
) |
Gets the shared file list from the server. For the synchronous method, see fetchGroupSharedFileList(String, int, int).
This is an asynchronous method.
groupId | The group ID. |
pageNum | The page number, starting from 1. |
pageSize | The number of shared files per page. |
callBack | The completion callback. If this call succeeds, calls ValueCallBack#onSuccess(Object) and returns the shared files; if this call fails, calls ValueCallBack#onError(int, String). |
Note the following:
void io.agora.chat.GroupManager.asyncGetBlockedUsers | ( | final String | groupId, |
final int | pageIndex, | ||
final int | pageSize, | ||
final ValueCallBack< List< String > > | callback | ||
) |
Gets the group blocklist with pagination. Only the group owner or admin can call this method. For the synchronous method, see getBlockedUsers(String, int, int).
This is an asynchronous method.
groupId | The group ID. |
pageIndex | The page number, starting from 1. |
pageSize | The number of groups per page. |
callback | The completion callback. If this call succeeds, calls ValueCallBack#onSuccess(Object) and returns the group blocklist; if this call fails, calls ValueCallBack#onError(int, String). |
void io.agora.chat.GroupManager.asyncGetBlockedUsers | ( | final String | groupId, |
final ValueCallBack< List< String > > | callback | ||
) |
Gets the group blocklist that can contain a maximum of 200 users by default. Only the group owner or admin can call this method. For the synchronous method, see getBlockedUsers(String).
This is an asynchronous method.
groupId | The group ID. |
callback | The completion callback. If this call succeeds, calls ValueCallBack#onSuccess(Object); if this call fails, calls ValueCallBack#onError(int, String). |
void io.agora.chat.GroupManager.asyncGetGroupFromServer | ( | final String | groupId, |
final ValueCallBack< Group > | callback | ||
) |
Gets group information from the server.
For the synchronous method, see getGroupFromServer(String).
This is an asynchronous method.
groupId | The group ID. |
callback | The completion callback. If this call succeeds, calls CallBack#onSuccess(); if this call fails, calls CallBack#onError(int, String). |
void io.agora.chat.GroupManager.asyncGetJoinedGroupsCountFromServer | ( | final ValueCallBack< Integer > | callback | ) |
Gets groups count of the current user joined from the server.
This is an asynchronous method.
callback | The completion callback. If this call succeeds, calls ValueCallBack#onSuccess(Object) and returns the group count if this call fails, calls ValueCallBack#onError(int, String); |
void io.agora.chat.GroupManager.asyncGetJoinedGroupsFromServer | ( | final int | pageIndex, |
final int | pageSize, | ||
boolean | needMemberCount, | ||
boolean | needRole, | ||
final ValueCallBack< List< Group > > | callback | ||
) |
Gets all groups of the current user from the server with pagination.
This method returns a group list which does not contain member information. If you want to update information of a group to include its member information, call getGroupFromServer(String groupId).
For the synchronous method, see getJoinedGroupsFromServer(int, int, boolean, boolean).
This is an asynchronous method.
pageIndex | The page number, starting from 0. |
pageSize | The number of groups per page.pageSize max 20 |
needMemberCount | Whether the number of group members is required. |
needRole | Whether the user's role in the group is required. |
callback | The completion callback. If this call succeeds, calls ValueCallBack#onSuccess(Object) and returns the group list on the next page; if this call fails, calls ValueCallBack#onError(int, String); |
void io.agora.chat.GroupManager.asyncGetJoinedGroupsFromServer | ( | final int | pageIndex, |
final int | pageSize, | ||
final ValueCallBack< List< Group > > | callback | ||
) |
Gets all groups of the current user from the server with pagination.
This method returns a group list which does not contain member information. If you want to update information of a group to include its member information, call getGroupFromServer(String groupId).
For the synchronous method, see getJoinedGroupsFromServer(int, int).
This is an asynchronous method.
pageIndex | The page number, starting from 1. |
pageSize | The number of groups per page. |
callback | The completion callback. If this call succeeds, calls ValueCallBack#onSuccess(Object) and returns the group list on the next page; if this call fails, calls ValueCallBack#onError(int, String); |
void io.agora.chat.GroupManager.asyncGetJoinedGroupsFromServer | ( | final ValueCallBack< List< Group > > | callback | ) |
Gets all groups of the current user from the server.
This method returns a group list which does not contain member information. If you want to update information of a group to include its member information, call getGroupFromServer(String groupId).
For a synchronous method, see getJoinedGroupsFromServer().
This is an asynchronous method.
callback | The completion callback. If this call succeeds, calls ValueCallBack#onSuccess(Object) and returns the list of groups that the user has joined; if the call fails, calls ValueCallBack#onError(int, String). |
void io.agora.chat.GroupManager.asyncGetPublicGroupsFromServer | ( | final int | pageSize, |
final String | cursor, | ||
final ValueCallBack< CursorResult< GroupInfo > > | callback | ||
) |
Gets public groups from the server with pagination.
For the synchronous method, see getPublicGroupsFromServer(int, String).
This is an asynchronous method.
pageSize | The number of public groups per page. |
cursor | The cursor position from which to start getting data next time. Sets the parameter as null for the first time. |
callback | The completion callback. If this call succeeds, calls ValueCallBack#onSuccess(Object) and returns the result of CursorResult), including the cursor for getting data next time and the group list. For the last page, the return value of cursor is an empty string. If this call fails, calls ValueCallBack#onError(int, String). |
void io.agora.chat.GroupManager.asyncInviteUser | ( | final String | groupId, |
final String[] | beInvitedUsernames, | ||
final String | reason, | ||
final CallBack | callback | ||
) |
Invites users to join a group. Note: The group style is GroupStyle#GroupStylePrivateMemberCanInvite, which allows group members to invite users. For the synchronous method, see inviteUser(String, String[], String)。
The is an asynchronous method.
groupId | The group ID. |
beInvitedUsernames | The array of users to be invited. |
reason | The reason for invitation. |
callback | The completion callback. If this call succeeds, calls CallBack#onSuccess(); if this call fails, calls CallBack#onError(int, String). |
void io.agora.chat.GroupManager.asyncJoinGroup | ( | final String | groupId, |
final CallBack | callback | ||
) |
Joins a public group.
For a group that requires no authentication,users can join it freely without the need of having permission.
For a group that requires authentication, users need to wait for the owner to agree before joing the group. For details, see GroupStyle.
For the synchronous method, see joinGroup(String).
This is an asynchronous method.
groupId | The group ID. |
callback | The completion callback. If this call succeeds, calls CallBack#onSuccess(); if this call fails, calls CallBack#onError(int, String). |
void io.agora.chat.GroupManager.asyncLeaveGroup | ( | final String | groupId, |
final CallBack | callback | ||
) |
Leaves a group.
This is an asynchronous method.
groupId | The group ID. |
callback | The completion callback. If this call succeeds, calls CallBack#onSuccess(); If this call fails, calls CallBack#onError(int, String). |
void io.agora.chat.GroupManager.asyncMuteGroupMembers | ( | final String | groupId, |
final List< String > | muteMembers, | ||
final long | duration, | ||
final ValueCallBack< Group > | callback | ||
) |
Mutes group members. Only the group owner or admin can call this method. For the synchronous method, see muteGroupMembers(String, List, long).
This is an asynchronous method.
groupId | The group ID. |
muteMembers | The list of members to be muted. |
duration | The mute duration in milliseconds. The value -1 indicates that the members are muted permanently. |
callback | The completion callback. If this call succeeds, calls ValueCallBack#onSuccess(Object) and returns the updated group instance; If this call fails, calls ValueCallBack#onError(int, String). |
void io.agora.chat.GroupManager.asyncRemoveGroupAdmin | ( | final String | groupId, |
final String | admin, | ||
final ValueCallBack< Group > | callback | ||
) |
Removes a group admin. Only the group owner can call this method. For the synchronous method, see removeGroupAdmin(String, String).
This is an asynchronous method.
groupId | The group ID. |
admin | The admin ID to remove. |
callback | The completion callback. If this call succeeds, calls ValueCallBack#onSuccess(Object) and returns the updated group instance; if this call succeeds, calls ValueCallBack#onError(int, String). |
void io.agora.chat.GroupManager.asyncRemoveUserFromGroup | ( | final String | groupId, |
final String | username, | ||
final CallBack | callback | ||
) |
Removes a member from the group. Only the group owner or admin can call this method. For the synchronous method, see removeUserFromGroup(String, String).
This is an asynchronous method.
groupId | The group ID. |
username | The user ID of the member to be removed. |
callback | The completion callback. If this call succeeds, calls CallBack#onSuccess(); if this call fails, calls CallBack#onError(int, String). |
void io.agora.chat.GroupManager.asyncRemoveUsersFromGroup | ( | final String | groupId, |
final List< String > | members, | ||
final CallBack | callback | ||
) |
Removes members from the group. Only the group owner or admin can call this method. For the synchronous method, see removeUsersFromGroup(String, List).
This is an asynchronous method.
groupId | The group ID. |
members | The user IDs of members to be removed. |
callback | The completion callback. If this call succeeds, calls CallBack#onSuccess(); if this call fails, calls CallBack#onError(int, String). |
void io.agora.chat.GroupManager.asyncSetGroupMemberAttributes | ( | String | groupId, |
String | userId, | ||
Map< String, String > | attributeMap, | ||
CallBack | callBack | ||
) |
Sets custom attributes of a group member.
groupId | The group ID. |
userId | The user ID of the group member for whom the custom attributes are set. |
attributeMap | The map of custom attributes in key-value format. In a key-value pair, if the value is set to an empty string, the custom attribute will be deleted. |
callBack | The completion callback. If this call succeeds, calls CallBack#onSuccess(); if this call fails, calls CallBack#onError(int, String). |
void io.agora.chat.GroupManager.asyncUnblockGroupMessage | ( | final String | groupId, |
final CallBack | callback | ||
) |
Unblocks group messages. For the synchronous method, see unblockGroupMessage(String).
This is an asynchronous method.
groupId | The group ID |
callback | The completion callback. If this call succeeds, calls CallBack#onSuccess(); if this call fails, calls CallBack#onError(int, String). |
void io.agora.chat.GroupManager.asyncUnblockUser | ( | final String | groupId, |
final String | username, | ||
final CallBack | callback | ||
) |
Removes a user from the group blocklist. Only the group owner or admin can call this method. For the synchronous method, see unblockUser(String, String).
This is an asynchronous method.
groupId | The group ID. |
username | The user to be removed from the group blocklist. |
callback | The completion callback. If this call succeeds, calls CallBack#onSuccess(); if this call fails, calls CallBack#onError(int, String). |
void io.agora.chat.GroupManager.asyncUnblockUsers | ( | final String | groupId, |
final List< String > | members, | ||
final CallBack | callback | ||
) |
Removes users from the group blocklist. Only the group owner or admin can call this method. For the synchronous method, see unblockUsers(String, List).
This is an asynchronous method.
groupId | The group ID. |
members | The users to be removed from the bloclist. |
callback | The completion callback. If this call succeeds, calls CallBack#onSuccess(); if this call fails, calls CallBack#onError(int, String). |
void io.agora.chat.GroupManager.asyncUnMuteGroupMembers | ( | final String | groupId, |
final List< String > | members, | ||
final ValueCallBack< Group > | callback | ||
) |
Unmutes group members. Only the group owner or admin can call this method. For the synchronious method, see unMuteGroupMembers(String, List).
This is an asynchronous method.
groupId | The group ID. |
members | The list of members to be unmuted. |
callback | The completion callback. If this call succeeds, calls ValueCallBack#onSuccess(Object) and returns the updated group instance; if this call fails, calls ValueCallBack#onError(int, String). |
void io.agora.chat.GroupManager.asyncUpdateGroupAnnouncement | ( | final String | groupId, |
final String | announcement, | ||
final CallBack | callBack | ||
) |
Updates the group announcement. Only the group owner or admin can call this method. For the synchronous method, see updateGroupAnnouncement(String, String)
This is an asynchronous method.
groupId | The group ID. |
announcement | The group announcement. |
callBack | The completion callback. If this call succeeds, calls CallBack#onSuccess(); if this call fails, calls CallBack#onError(int, String). |
void io.agora.chat.GroupManager.asyncUploadGroupSharedFile | ( | final String | groupId, |
final String | filePath, | ||
final CallBack | callBack | ||
) |
Uploads the shared file to the group.
For the synchronous method, see uploadGroupSharedFile(String, String, CallBack).
This is an asynchronous method.
groupId | The group ID. |
filePath | The local file path. |
callBack | The completion callback. If this call succeeds, calls CallBack#onSuccess(); if this call fails, calls CallBack#onError(int, String). Calls CallBack#onSuccess() to view the upload progress. @Deprecated Deprecated. Please use asyncUploadGroupSharedFile(String, String, ValueCallBack) instead. |
void io.agora.chat.GroupManager.asyncUploadGroupSharedFile | ( | final String | groupId, |
final String | filePath, | ||
final ValueCallBack< MucSharedFile > | callBack | ||
) |
Uploads the shared file to the group.
For the synchronous method, see uploadGroupSharedFile(String, String, CallBack).
This is an asynchronous method.
groupId | The group ID. |
filePath | The local file path. |
callBack | The completion callback. If this call succeeds, calls ValueCallBack#onSuccess(Object); if this call fails, calls ValueCallBack#onError(int, String). Calls ValueCallBack#onSuccess(Object) to view the upload progress. |
void io.agora.chat.GroupManager.blockGroupMessage | ( | String | groupId | ) | throws ChatException |
Blocks group messages. The user that blocks group messages is still a group member, but can't receive group messages. For the asynchronous method, see asyncBlockGroupMessage(String, CallBack).
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
ChatException | A description of the exception. See Error. |
void io.agora.chat.GroupManager.blockUser | ( | String | groupId, |
String | username | ||
) | throws ChatException |
Adds the user to the group blocklist. Users will be first removed from the group they have joined before being added to the group blocklist. The users on the group blocklist can not join the group again. Only the group owner or admin can call this method. For the asynchronous method, see asyncBlockUser(String, String, CallBack).
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
username | The user to be added to the blocklist. |
ChatException | A description of the exception. See Error. |
void io.agora.chat.GroupManager.blockUsers | ( | String | groupId, |
List< String > | members | ||
) | throws ChatException |
Adds the user to the group blocklist. Users will be first removed from the group they have joined before being added to the group blocklist. The users on the group blocklist can not join the group again. Only the group owner or admin can call this method. For the asynchronous method, see asyncBlockUsers(String, List, CallBack).
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
members | The list of users to be added to the blocklist. |
ChatException | A description of the exception. See Error. |
void io.agora.chat.GroupManager.changeGroupDescription | ( | String | groupId, |
String | changedDescription | ||
) | throws ChatException |
Changes the group description.
Only the group owner or admin can call this method.
For the asynchronous method, see asyncChangeGroupDescription(String, String, CallBack).
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
changedDescription | The new group description. |
ChatException | A description of the exception. See Error. |
void io.agora.chat.GroupManager.changeGroupName | ( | String | groupId, |
String | changedGroupName | ||
) | throws ChatException |
Changes the group name.
Only the group owner or admin can call this method.
For the asynchronous method, see asyncChangeGroupName(String, String, CallBack).
This is a synchronous method and blocks the current thread.
groupId | The ID of group whose name is to be changed. |
changedGroupName | The new group name. |
ChatException | A description of the exception. See Error. |
Group io.agora.chat.GroupManager.changeOwner | ( | String | groupId, |
String | newOwner | ||
) | throws ChatException |
Transfers the group ownership. Only the group owner can call this method. For the asynchronous method, see asyncChangeOwner(String, String, ValueCallBack).
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
newOwner | The new owner ID. |
ChatException | A description of the exception. See Error. |
void io.agora.chat.GroupManager.checkIfInGroupWhiteList | ( | final String | groupId, |
ValueCallBack< Boolean > | callBack | ||
) |
Gets whether the member is on the allowlist.
This is an asynchronous method.
groupId | The group ID. |
callBack | The completion callback. If this call succeeds, calls ValueCallBack#onSuccess(Object) and returns a Boolean value to indicate whether the current user is on the group blocklist; if this call fails, calls ValueCallBack#onError(int, String). |
void io.agora.chat.GroupManager.cleanAllGroupsFromLocal | ( | ) |
Clear all local group details from the database and memory.
Group io.agora.chat.GroupManager.createGroup | ( | String | groupName, |
String | desc, | ||
String[] | allMembers, | ||
String | reason, | ||
GroupOptions | option | ||
) | throws ChatException |
Creates a group instance. After the group is created, the data in the cache and database will be updated and multiple devices will receive the notification event and update the group to the cache and database. You can set io.agora.MultiDeviceListener to listen on the event. The event callback function is io.agora.MultiDeviceListener#onGroupEvent(int, String, List), where the first parameter is the event, for example, io.agora.MultiDeviceListener#GROUP_CREATE for the group creation event. For the asynchronous method, see asyncCreateGroup(String, String, String[], String, GroupOptions, ValueCallBack).
This is a synchronous method and blocks the current thread.
groupName | The group name. It is optional. Pass null if you do not want to set this parameter. |
desc | The group description. It is optional. Pass null if you do not want to set this parameter. |
allMembers | The group member array. The group owner ID is optional. This parameter can not be null. |
reason | The group joining invitation. It is optional. Pass null if you do not want to set this parameter. |
option | The options for creating a group. They are optional and can not be null. See GroupOptions. The options are as follows:
|
ChatException | A description of the exception. See Error. |
void io.agora.chat.GroupManager.declineApplication | ( | String | username, |
String | groupId, | ||
String | reason | ||
) | throws ChatException |
Declines a group request. Only the group owner or admin can call this method. For the asynchronous method, see asyncDeclineApplication(String, String, String, CallBack).
Only the group owner or admin can call this method.
username | The ID of the user who sends the request for join the group. |
groupId | The group ID. |
reason | The reason of declining. |
ChatException | A description of the exception. See Error. |
void io.agora.chat.GroupManager.declineInvitation | ( | String | groupId, |
String | inviter, | ||
String | reason | ||
) | throws ChatException |
Declines a group invitation. For the asynchronous method, see asyncDeclineInvitation(String, String, String, CallBack).
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
inviter | The inviter. |
reason | The reason for declining. |
ChatException | A description of the exception. See Error. |
void io.agora.chat.GroupManager.deleteGroupSharedFile | ( | String | groupId, |
String | fileId | ||
) | throws ChatException |
Removes a shared file of the group. Group members can delete their own uploaded files. The group owner or admin can delete all shared files. For the asynchronous method, see asyncDeleteGroupSharedFile(String, String, CallBack).
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
fileId | The shared file ID. |
ChatException | Only the group owner or admin can call this method. See Error. |
void io.agora.chat.GroupManager.destroyGroup | ( | final String | groupId | ) | throws ChatException |
Destroys the group instance. Only the group owner can call this method. For the asynchronous method, see asyncDestroyGroup(String, CallBack).
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
ChatException | A description of the exception. See Error. |
void io.agora.chat.GroupManager.downloadGroupSharedFile | ( | String | groupId, |
String | fileId, | ||
String | savePath, | ||
CallBack | callBack | ||
) | throws ChatException |
Downloads the shared file of the group. Note: The callback is only used for progress callback. For the asynchronous method, see asyncDownloadGroupSharedFile(String, String, String, CallBack).
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
fileId | The ID of the shared file. |
savePath | The local file path. |
callBack | The file download progress callback. |
ChatException | A description of the exception. See Error. |
String io.agora.chat.GroupManager.fetchGroupAnnouncement | ( | String | groupId | ) | throws ChatException |
Gets the group announcement from the server. Group members can call this method. For the asynchronous method, see asyncFetchGroupAnnouncement(String, ValueCallBack).
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
ChatException | A description of the exception. See Error. |
List< String > io.agora.chat.GroupManager.fetchGroupBlackList | ( | String | groupId, |
int | pageNum, | ||
int | pageSize | ||
) | throws ChatException |
Gets the blocklist of group from the server with pagination. Only the group owner or admin can call this method. For the asynchronous method, see asyncFetchGroupBlackList(String, int, int, ValueCallBack).
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
pageNum | The page number, starting from 1. |
pageSize | The number of users on the blocklist per page. |
ChatException | A description of the exception. See Error. |
CursorResult< String > io.agora.chat.GroupManager.fetchGroupMembers | ( | String | groupId, |
String | cursor, | ||
int | pageSize | ||
) | throws ChatException |
Gets a group's member list with pagination. When CursorResult.getCursor() is an empty string ("") in the result, there is no more data. For the asynchronous method, see asyncFetchGroupMembers(String, String, int, ValueCallBack).
Synchronization method will block the current thread.
For example:
groupId | The group ID. |
cursor | The cursor position from which to start to get data next time. Sets the parameter as null for the first time. |
pageSize | The number of group members per page. |
ChatException | A description of the exception. See Error |
Map< String, Long > io.agora.chat.GroupManager.fetchGroupMuteList | ( | String | groupId, |
int | pageNum, | ||
int | pageSize | ||
) | throws ChatException |
Gets the mutelist of the group from the server. Only the group owner or admin can call this method. For the asynchronous method, see asyncFetchGroupMuteList(String, int, int, ValueCallBack).
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
pageNum | The page number, starting from 1. |
pageSize | The cursor position from which to start to get data next time. |
ChatException | A description of the exception. See Error. |
List< MucSharedFile > io.agora.chat.GroupManager.fetchGroupSharedFileList | ( | String | groupId, |
int | pageNum, | ||
int | pageSize | ||
) | throws ChatException |
Gets the shared files of group from the server. For the asynchronous method, see asyncFetchGroupSharedFileList(String, int, int, ValueCallBack).
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
pageNum | The page number, starting from 1. |
pageSize | The number of shared files per page. |
ChatException | A description of the exception. See Error. |
void io.agora.chat.GroupManager.fetchGroupWhiteList | ( | final String | groupId, |
final ValueCallBack< List< String > > | callBack | ||
) |
Gets the allowlist of group from the server. Only the group owner or admin can call this method.
This is an asynchronous method.
groupId | The group ID. |
callBack | The completion callback. If this call succeeds, calls ValueCallBack#onSuccess(Object) and return the group blocklist; if this call fails, calls ValueCallBack#onError(int, String). |
List< Group > io.agora.chat.GroupManager.getAllGroups | ( | ) |
Gets all groups of the current user (from the cache). Before a call to this method, call loadAllGroups() to load data from the group to the cache. If loadAllGroups() is not called, this method will load data from the database before loading from the cache.
List< String > io.agora.chat.GroupManager.getBlockedUsers | ( | String | groupId | ) | throws ChatException |
Gets the group blocklist that can contain a maximum of 200 users by default. Only the group owner or admin can call this method. For the asynchronous method, see asyncGetBlockedUsers(String, ValueCallBack).
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
ChatException | A description of the exception. See Error. |
List< String > io.agora.chat.GroupManager.getBlockedUsers | ( | String | groupId, |
int | pageIndex, | ||
int | pageSize | ||
) | throws ChatException |
Gets the group blocklist from server with pagination. Only the group owner or admin can call this method. For the asynchronous method, see asyncGetBlockedUsers(String, int, int, ValueCallBack).
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
pageIndex | The page number, starting from 1. |
pageSize | The number of groups per page. |
ChatException | A description of the exception. See Error. |
Group io.agora.chat.GroupManager.getGroup | ( | String | groupId | ) |
Gets the group instance from the cache by group ID.
groupId | The group ID. |
Group io.agora.chat.GroupManager.getGroupFromServer | ( | String | groupId | ) | throws ChatException |
Gets group information from the server. This method does not get member information. If member information is required, call fetchGroupMembers(String, String, int). For the asynchronous method, see asyncGetGroupFromServer(String, ValueCallBack).
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
ChatException | A description of the exception. See Error. |
Group io.agora.chat.GroupManager.getGroupFromServer | ( | String | groupId, |
boolean | fetchMembers | ||
) | throws ChatException |
Gets group information from the server.
If fetchMembers is set to true, a member list is also fetched. If more members need to be fetched, call fetchGroupMembers(String, String, int).
Only members in the group can get the member list of the group.
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
fetchMembers | Whether to get group members. By default, a list of 200 members is fetched. |
ChatException | A description of the exception. See Error. |
synchronized List< Group > io.agora.chat.GroupManager.getJoinedGroupsFromServer | ( | ) | throws ChatException |
Gets all groups of the current user from the server. This method returns a group list which does not contain member information. If you want to update information of a group to include its member information, call getGroupFromServer(String groupId). For the asynchronous method, see asyncGetJoinedGroupsFromServer(ValueCallBack).
This is a synchronous method and blocks the current thread.
ChatException | A description of the exception. See Error. |
synchronized List< Group > io.agora.chat.GroupManager.getJoinedGroupsFromServer | ( | int | pageIndex, |
int | pageSize | ||
) | throws ChatException |
Gets all groups of the current user from the server with pagination. This method returns a group list which does not contain member information. If you want to update information of a group to include its member information, call getGroupFromServer(String groupId). For the asynchronous method, see asyncGetJoinedGroupsFromServer(int, int, ValueCallBack).
This is a synchronous method and blocks the current thread.
pageIndex | The page number, starting from 1. |
pageSize | The number of groups per page. |
ChatException | A description of the exception. See Error. |
synchronized List< Group > io.agora.chat.GroupManager.getJoinedGroupsFromServer | ( | int | pageIndex, |
int | pageSize, | ||
boolean | needMemberCount, | ||
boolean | needRole | ||
) | throws ChatException |
Gets all groups of the current user from the server with pagination. This method returns a group list which does not contain member information. If you want to update information of a group to include its member information, call getGroupFromServer(String groupId). For the asynchronous method, see asyncGetJoinedGroupsFromServer(int, int, boolean, boolean, ValueCallBack).
This is a synchronous method and blocks the current thread.
pageIndex | The page number, starting from 0. |
pageSize | The number of groups per page. pageSize max 20 |
needMemberCount | Whether the number of group members is required. |
needRole | Whether the user's role in the group is required. |
ChatException | A description of the exception. See Error. |
CursorResult< GroupInfo > io.agora.chat.GroupManager.getPublicGroupsFromServer | ( | int | pageSize, |
String | cursor | ||
) | throws ChatException |
Gets public groups from the server with pagination.
For the asynchronous method, see asyncGetPublicGroupsFromServer(int, String, ValueCallBack).
This is a synchronous method and blocks the current thread.
pageSize | The number of public groups per page. |
cursor | The cursor position from which to start to get data next time. Sets the parameter as null for the first time. |
ChatException | A description of the exception. See Error. |
void io.agora.chat.GroupManager.inviteUser | ( | String | groupId, |
String[] | beInvitedUsernames, | ||
String | reason | ||
) | throws ChatException |
Invites users to join a group. Note: The group style is GroupStyle#GroupStylePrivateMemberCanInvite, which allows group members to invite users. For the asynchronous method, see asyncInviteUser(String, String[], String, CallBack).
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
beInvitedUsernames | The array of users to be invited. |
reason | The reason for invitation. |
ChatException | A description of the exception. See Error. |
void io.agora.chat.GroupManager.joinGroup | ( | String | groupId | ) | throws ChatException |
Joins a public group.
For a group that requires no authentication,users can join it freely without the need of having permission.
For a group that requires authentication, users need to wait for the owner to agree before joing the group. For details, see GroupStyle.
For the asynchronous method, see asyncJoinGroup(String, CallBack).
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
ChatException | A description of the exception. See Error. |
void io.agora.chat.GroupManager.leaveGroup | ( | String | groupId | ) | throws ChatException |
Leaves a group.
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
ChatException | A description of the exception. See Error. |
synchronized void io.agora.chat.GroupManager.loadAllGroups | ( | ) |
Loads all local groups from the database.
void io.agora.chat.GroupManager.muteAllMembers | ( | final String | groupId, |
final ValueCallBack< Group > | callBack | ||
) |
Mutes all members. Only the group owner or admin can call this method.
This is an asynchronous method.
groupId | The group ID. |
callBack | The completion callback. If this call succeeds, calls ValueCallBack#onSuccess(Object) and returns the updated group instance; if this call fails, calls ValueCallBack#onError(int, String). |
Group io.agora.chat.GroupManager.muteGroupMembers | ( | String | groupId, |
List< String > | muteMembers, | ||
long | duration | ||
) | throws ChatException |
Mutes group members. Only the group owner or admin can call this method. For the asynchronous method, see asyncMuteGroupMembers(String, List, long, ValueCallBack).
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
muteMembers | The list of members to be muted. |
duration | The mute duration in milliseconds. The value -1 indicates that the members are muted permanently. |
ChatException | A description of the exception. See Error. |
void io.agora.chat.GroupManager.removeFromGroupWhiteList | ( | final String | groupId, |
final List< String > | members, | ||
final CallBack | callBack | ||
) |
Removes members from the allowlist. Only the group owner or admin can call this method.
This is an asynchronous method.
groupId | The group ID. |
members | The members to be removed from the allowlist. |
callBack | The completion callback. If this call succeeds, calls CallBack#onSuccess(); if this call fails, calls CallBack#onError(int, String). |
Group io.agora.chat.GroupManager.removeGroupAdmin | ( | String | groupId, |
String | admin | ||
) | throws ChatException |
Removes a group admin. Only the group owner can call this method. For the asynchronous method, see asyncRemoveGroupAdmin(String, String, ValueCallBack).
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
admin | The admin ID to remove. |
ChatException | A description of the exception. See Error. |
void io.agora.chat.GroupManager.removeGroupChangeListener | ( | GroupChangeListener | listener | ) |
Removes a group change listener. This method removes a group change listener registered with addGroupChangeListener(GroupChangeListener).
listener | The group event listener to be removed. |
void io.agora.chat.GroupManager.removeUserFromGroup | ( | final String | groupId, |
final String | username | ||
) | throws ChatException |
Removes a member from the group. Only the group owner or admin can call this method. For the asynchronous method, see asyncRemoveUserFromGroup(String, String, CallBack).
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
username | The user ID of the member to be removed. |
ChatException | A description of the exception. See Error. |
void io.agora.chat.GroupManager.removeUsersFromGroup | ( | final String | groupId, |
final List< String > | members | ||
) | throws ChatException |
Removes members from the group. Only the group owner or admin can call this method. For the asynchronous method, see removeUsersFromGroup(String, List)}.
Only the group owner or admin can call this method.
groupId | The group ID. |
members | The user IDs of members to be removed. |
ChatException | A description of the exception. See Error. |
void io.agora.chat.GroupManager.unblockGroupMessage | ( | String | groupId | ) | throws ChatException |
Unblocks group messages. For the asynchronous method, see asyncUnblockGroupMessage(String, CallBack).
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
ChatException | A description of the exception. See Error. |
void io.agora.chat.GroupManager.unblockUser | ( | String | groupId, |
String | username | ||
) | throws ChatException |
Removes a user from the group blocklist. Only the group owner or admin can call this method. For the asynchronous method, see asyncUnblockUser(String, String, CallBack).
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
username | The user to be removed from the group blocklist. |
ChatException | A description of the exception. See Error. |
void io.agora.chat.GroupManager.unblockUsers | ( | String | groupId, |
List< String > | members | ||
) | throws ChatException |
Removes users from the group blocklist. Only the group owner or admin can call this method. For the asynchronous method, see asyncBlockUsers(String, List, CallBack).
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
members | The users to be removed from the group blocklist. |
ChatException | A description of the exception. See Error. |
void io.agora.chat.GroupManager.unmuteAllMembers | ( | final String | groupId, |
final ValueCallBack< Group > | callBack | ||
) |
Unmutes all members. Only the group owner or admin can call this method.
This is an asynchronous method.
groupId | The group ID. |
callBack | The completion callback. If this call succeeds, calls ValueCallBack#onSuccess(Object) and returns the updated group instance; if this call fails, calls ValueCallBack#onError(int, String). |
Group io.agora.chat.GroupManager.unMuteGroupMembers | ( | String | groupId, |
List< String > | members | ||
) | throws ChatException |
Unmutes group members. Only the group owner or admin can call this method. For the asynchronous method, see asyncUnMuteGroupMembers(String, List, ValueCallBack).
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
members | The list of members to be muted. |
ChatException | A description of the exception. See Error. |
void io.agora.chat.GroupManager.updateGroupAnnouncement | ( | String | groupId, |
String | announcement | ||
) | throws ChatException |
Updates the group announcement. Only the group owner or admin can call this method. For the asynchronous method, see asyncUpdateGroupAnnouncement(String, String, CallBack).
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
announcement | The group announcement. |
ChatException | A description of the exception. See Error. |
Group io.agora.chat.GroupManager.updateGroupExtension | ( | String | groupId, |
String | extension | ||
) | throws ChatException |
Updates the group extension field. Only the group owner or admin can call this method.
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
extension | The group extension field. |
ChatException | A description of the exception. See Error. |
MucSharedFile io.agora.chat.GroupManager.uploadGroupSharedFile | ( | String | groupId, |
String | filePath, | ||
CallBack | callBack | ||
) | throws ChatException |
Uploads the shared file to the group. Note: The callback is only used for progress callback. For the asynchronous method, see asyncUploadGroupSharedFile(String, String, ValueCallBack).
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
filePath | The local file path. |
callBack | The file upload progress callback. |
ChatException | A description of the exception. See Error. |