hyphenate_SDK4.0 4.8.0
hyphenate java IM SDK
|
Classes | |
enum | EMGroupStyle |
Public Member Functions | |
List< EMGroup > | getAllGroups () |
EMGroup | getGroup (String groupId) |
EMGroup | createGroup (String groupName, String desc, String[] allMembers, String reason, EMGroupOptions option) throws HyphenateException |
void | asyncCreateGroup (final String groupName, final String desc, final String[] allMembers, final String reason, final EMGroupOptions option, final EMValueCallBack< EMGroup > callback) |
synchronized void | loadAllGroups () |
void | destroyGroup (final String groupId) throws HyphenateException |
void | asyncDestroyGroup (final String groupId, final EMCallBack callback) |
void | addUsersToGroup (String groupId, String[] newmembers) throws HyphenateException |
void | addUsersToGroup (String groupId, String[] newmembers, String welcomeMessage) throws HyphenateException |
void | asyncAddUsersToGroup (final String groupId, final String[] newmembers, final EMCallBack callback) |
void | removeUserFromGroup (final String groupId, final String username) throws HyphenateException |
void | asyncRemoveUserFromGroup (final String groupId, final String username, final EMCallBack callback) |
void | removeUsersFromGroup (final String groupId, final List< String > members) throws HyphenateException |
void | asyncRemoveUsersFromGroup (final String groupId, final List< String > members, final EMCallBack callback) |
void | leaveGroup (String groupId) throws HyphenateException |
void | asyncLeaveGroup (final String groupId, final EMCallBack callback) |
EMGroup | getGroupFromServer (String groupId) throws HyphenateException |
EMGroup | getGroupFromServer (String groupId, boolean fetchMembers) throws HyphenateException |
void | asyncGetGroupFromServer (final String groupId, final EMValueCallBack< EMGroup > callback) |
synchronized List< EMGroup > | getJoinedGroupsFromServer () throws HyphenateException |
synchronized List< EMGroup > | getJoinedGroupsFromServer (int pageIndex, int pageSize) throws HyphenateException |
synchronized List< EMGroup > | getJoinedGroupsFromServer (int pageIndex, int pageSize, boolean needMemberCount, boolean needRole) throws HyphenateException |
void | asyncGetJoinedGroupsFromServer (final EMValueCallBack< List< EMGroup > > callback) |
void | asyncGetJoinedGroupsFromServer (final int pageIndex, final int pageSize, final EMValueCallBack< List< EMGroup > > callback) |
void | asyncGetJoinedGroupsFromServer (final int pageIndex, final int pageSize, boolean needMemberCount, boolean needRole, final EMValueCallBack< List< EMGroup > > callback) |
void | asyncGetJoinedGroupsCountFromServer (final EMValueCallBack< Integer > callback) |
EMCursorResult< EMGroupInfo > | getPublicGroupsFromServer (int pageSize, String cursor) throws HyphenateException |
void | asyncGetPublicGroupsFromServer (final int pageSize, final String cursor, final EMValueCallBack< EMCursorResult< EMGroupInfo > > callback) |
void | joinGroup (String groupId) throws HyphenateException |
void | asyncJoinGroup (final String groupId, final EMCallBack callback) |
void | changeGroupName (String groupId, String changedGroupName) throws HyphenateException |
void | asyncChangeGroupName (final String groupId, final String changedGroupName, final EMCallBack callback) |
void | changeGroupDescription (String groupId, String changedDescription) throws HyphenateException |
void | asyncChangeGroupDescription (final String groupId, final String changedDescription, final EMCallBack callBack) |
EMGroup | acceptInvitation (String groupId, String inviter) throws HyphenateException |
void | asyncAcceptInvitation (final String groupId, final String inviter, final EMValueCallBack< EMGroup > callback) |
void | declineInvitation (String groupId, String inviter, String reason) throws HyphenateException |
void | asyncDeclineInvitation (final String groupId, final String inviter, final String reason, final EMCallBack callback) |
void | acceptApplication (String username, String groupId) throws HyphenateException |
void | asyncAcceptApplication (final String username, final String groupId, final EMCallBack callback) |
void | declineApplication (String username, String groupId, String reason) throws HyphenateException |
void | asyncDeclineApplication (final String username, final String groupId, final String reason, final EMCallBack callback) |
void | inviteUser (String groupId, String[] beInvitedUsernames, String reason) throws HyphenateException |
void | asyncInviteUser (final String groupId, final String[] beInvitedUsernames, final String reason, final EMCallBack callback) |
void | applyJoinToGroup (String groupId, String reason) throws HyphenateException |
void | asyncApplyJoinToGroup (final String groupId, final String reason, final EMCallBack callback) |
void | blockGroupMessage (String groupId) throws HyphenateException |
void | asyncBlockGroupMessage (final String groupId, final EMCallBack callback) |
void | unblockGroupMessage (String groupId) throws HyphenateException |
void | asyncUnblockGroupMessage (final String groupId, final EMCallBack callback) |
void | blockUser (String groupId, String username) throws HyphenateException |
void | asyncBlockUser (final String groupId, final String username, final EMCallBack callback) |
void | blockUsers (String groupId, List< String > members) throws HyphenateException |
void | asyncBlockUsers (final String groupId, final List< String > members, final EMCallBack callback) |
void | unblockUser (String groupId, String username) throws HyphenateException |
void | asyncUnblockUser (final String groupId, final String username, final EMCallBack callback) |
void | unblockUsers (String groupId, List< String > members) throws HyphenateException |
void | asyncUnblockUsers (final String groupId, final List< String > members, final EMCallBack callback) |
List< String > | getBlockedUsers (String groupId) throws HyphenateException |
List< String > | getBlockedUsers (String groupId, int pageIndex, int pageSize) throws HyphenateException |
void | asyncGetBlockedUsers (final String groupId, final EMValueCallBack< List< String > > callback) |
void | asyncGetBlockedUsers (final String groupId, final int pageIndex, final int pageSize, final EMValueCallBack< List< String > > callback) |
void | addGroupChangeListener (EMGroupChangeListener listener) |
void | removeGroupChangeListener (EMGroupChangeListener listener) |
EMCursorResult< String > | fetchGroupMembers (String groupId, String cursor, int pageSize) throws HyphenateException |
void | asyncFetchGroupMembers (final String groupId, final String cursor, final int pageSize, final EMValueCallBack< EMCursorResult< String > > callback) |
EMGroup | changeOwner (String groupId, String newOwner) throws HyphenateException |
void | asyncChangeOwner (final String groupId, final String newOwner, final EMValueCallBack< EMGroup > callback) |
EMGroup | addGroupAdmin (final String groupId, final String admin) throws HyphenateException |
void | asyncAddGroupAdmin (final String groupId, final String admin, final EMValueCallBack< EMGroup > callback) |
EMGroup | removeGroupAdmin (String groupId, String admin) throws HyphenateException |
void | asyncRemoveGroupAdmin (final String groupId, final String admin, final EMValueCallBack< EMGroup > callback) |
EMGroup | muteGroupMembers (String groupId, List< String > muteMembers, long duration) throws HyphenateException |
void | asyncMuteGroupMembers (final String groupId, final List< String > muteMembers, final long duration, final EMValueCallBack< EMGroup > callback) |
EMGroup | unMuteGroupMembers (String groupId, List< String > members) throws HyphenateException |
void | asyncUnMuteGroupMembers (final String groupId, final List< String > members, final EMValueCallBack< EMGroup > callback) |
Map< String, Long > | fetchGroupMuteList (String groupId, int pageNum, int pageSize) throws HyphenateException |
void | asyncFetchGroupMuteList (final String groupId, final int pageNum, final int pageSize, final EMValueCallBack< Map< String, Long > > callBack) |
List< String > | fetchGroupBlackList (String groupId, int pageNum, int pageSize) throws HyphenateException |
void | asyncFetchGroupBlackList (final String groupId, final int pageNum, final int pageSize, final EMValueCallBack< List< String > > callBack) |
void | addToGroupWhiteList (final String groupId, final List< String > members, final EMCallBack callBack) |
void | removeFromGroupWhiteList (final String groupId, final List< String > members, final EMCallBack callBack) |
void | checkIfInGroupWhiteList (final String groupId, EMValueCallBack< Boolean > callBack) |
void | fetchGroupWhiteList (final String groupId, final EMValueCallBack< List< String > > callBack) |
void | muteAllMembers (final String groupId, final EMValueCallBack< EMGroup > callBack) |
void | unmuteAllMembers (final String groupId, final EMValueCallBack< EMGroup > callBack) |
void | updateGroupAnnouncement (String groupId, String announcement) throws HyphenateException |
void | asyncUpdateGroupAnnouncement (final String groupId, final String announcement, final EMCallBack callBack) |
String | fetchGroupAnnouncement (String groupId) throws HyphenateException |
void | asyncFetchGroupAnnouncement (final String groupId, final EMValueCallBack< String > callBack) |
EMMucSharedFile | uploadGroupSharedFile (String groupId, String filePath, EMCallBack callBack) throws HyphenateException |
void | asyncUploadGroupSharedFile (final String groupId, final String filePath, final EMCallBack callBack) |
void | asyncUploadGroupSharedFile (final String groupId, final String filePath, final EMValueCallBack< EMMucSharedFile > callBack) |
List< EMMucSharedFile > | fetchGroupSharedFileList (String groupId, int pageNum, int pageSize) throws HyphenateException |
void | asyncFetchGroupSharedFileList (final String groupId, final int pageNum, final int pageSize, final EMValueCallBack< List< EMMucSharedFile > > callBack) |
void | deleteGroupSharedFile (String groupId, String fileId) throws HyphenateException |
void | asyncDeleteGroupSharedFile (final String groupId, final String fileId, final EMCallBack callBack) |
void | downloadGroupSharedFile (String groupId, String fileId, String savePath, EMCallBack callBack) throws HyphenateException |
void | asyncDownloadGroupSharedFile (final String groupId, final String fileId, final String savePath, final EMCallBack callBack) |
void | asyncSetGroupMemberAttributes (String groupId, String userId, Map< String, String > attributeMap, EMCallBack callBack) |
void | asyncFetchGroupMemberAllAttributes (String groupId, String userId, EMValueCallBack< Map< String, Map< String, String > > > callBack) |
void | asyncFetchGroupMembersAttributes (String groupId, List< String > userList, List< String > keyList, EMValueCallBack< Map< String, Map< String, String > > > callBack) |
EMGroup | updateGroupExtension (String groupId, String extension) throws HyphenateException |
void | cleanAllGroupsFromLocal () |
The group manager for management of group creation and deletion and member management.
void com.hyphenate.chat.EMGroupManager.acceptApplication | ( | String | username, |
String | groupId | ||
) | throws HyphenateException |
Approves a group request. Only the group owner or admin can call this method. For the asynchronous method, see asyncAcceptApplication(String, String, EMCallBack).
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. |
HyphenateException | A description of the exception. See EMError. |
EMGroup com.hyphenate.chat.EMGroupManager.acceptInvitation | ( | String | groupId, |
String | inviter | ||
) | throws HyphenateException |
Accepts a group invitation. For the asynchronous method, see asyncAcceptInvitation(String, String, EMValueCallBack)。
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
inviter | The user who initiates the invitation. |
HyphenateException | A description of the exception. see EMError. |
EMGroup com.hyphenate.chat.EMGroupManager.addGroupAdmin | ( | final String | groupId, |
final String | admin | ||
) | throws HyphenateException |
Adds a group admin. Only the group owner can call this method and admin can not. For the asynchronous method, see asyncAddGroupAdmin(String, String, EMValueCallBack).
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
admin | The admin ID to add. |
HyphenateException | A description of the exception. See EMError. |
void com.hyphenate.chat.EMGroupManager.addGroupChangeListener | ( | EMGroupChangeListener | listener | ) |
Registers a group change listener. The registered listener needs to be used together with removeGroupChangeListener(EMGroupChangeListener).
listener | The group event listener to be registered. |
void com.hyphenate.chat.EMGroupManager.addToGroupWhiteList | ( | final String | groupId, |
final List< String > | members, | ||
final EMCallBack | 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 EMCallBack#onSuccess(); if this call fails, calls EMCallBack#onError(int, String). |
void com.hyphenate.chat.EMGroupManager.addUsersToGroup | ( | String | groupId, |
String[] | newmembers | ||
) | throws HyphenateException |
Adds users to the group. Only the group creator or admin can call this method. For the asynchronous method, see asyncAddUsersToGroup(String, String[], EMCallBack).
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
newmembers | The array of new members to add. |
HyphenateException | A description of the exception. See EMError. |
void com.hyphenate.chat.EMGroupManager.addUsersToGroup | ( | String | groupId, |
String[] | newmembers, | ||
String | welcomeMessage | ||
) | throws HyphenateException |
Adds users to the group. Only the group owner or admin can call this method. For the asynchronous method, see asyncAddUsersToGroup(String, String[], EMCallBack).
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. |
HyphenateException | A description of the exception. See EMError. |
void com.hyphenate.chat.EMGroupManager.applyJoinToGroup | ( | String | groupId, |
String | reason | ||
) | throws HyphenateException |
Requests to join a group. Note: The group style is EMGroupStyle#EMGroupStylePublicJoinNeedApproval, which is a public group requiring authentication. For an asynchronous method, see asyncApplyJoinToGroup(String, String, EMCallBack).
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
reason | The reason for requesting to join the group. |
HyphenateException | A description of the exception. See EMError. |
void com.hyphenate.chat.EMGroupManager.asyncAcceptApplication | ( | final String | username, |
final String | groupId, | ||
final EMCallBack | 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 EMCallBack#onSuccess(); if this call fails, calls EMCallBack#onError(int, String) if it does not. |
void com.hyphenate.chat.EMGroupManager.asyncAcceptInvitation | ( | final String | groupId, |
final String | inviter, | ||
final EMValueCallBack< EMGroup > | 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 EMValueCallBack#onSuccess(Object) and returns the updated group instance; if this call fails, calls EMValueCallBack#onError(int, String). |
void com.hyphenate.chat.EMGroupManager.asyncAddGroupAdmin | ( | final String | groupId, |
final String | admin, | ||
final EMValueCallBack< EMGroup > | 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 EMValueCallBack#onSuccess(Object) and returns the updated group instance; If this call fails, calls EMValueCallBack#onError(int, String). |
void com.hyphenate.chat.EMGroupManager.asyncAddUsersToGroup | ( | final String | groupId, |
final String[] | newmembers, | ||
final EMCallBack | 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 EMCallBack#onSuccess(); If this call fails, calls EMCallBack#onError(int, String). |
void com.hyphenate.chat.EMGroupManager.asyncApplyJoinToGroup | ( | final String | groupId, |
final String | reason, | ||
final EMCallBack | callback | ||
) |
Requests to join a group. Note: The group style is EMGroupStyle#EMGroupStylePublicJoinNeedApproval, 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 EMCallBack#onSuccess(); if this call fails, calls EMCallBack#onError(int, String). |
void com.hyphenate.chat.EMGroupManager.asyncBlockGroupMessage | ( | final String | groupId, |
final EMCallBack | 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 EMCallBack#onSuccess(); if this call fails, calls EMCallBack#onError(int, String). |
void com.hyphenate.chat.EMGroupManager.asyncBlockUser | ( | final String | groupId, |
final String | username, | ||
final EMCallBack | 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 EMCallBack#onSuccess(); If this call fails, calls EMCallBack#onError(int, String). |
void com.hyphenate.chat.EMGroupManager.asyncBlockUsers | ( | final String | groupId, |
final List< String > | members, | ||
final EMCallBack | 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 EMCallBack#onSuccess(); if this call fails, calls EMCallBack#onError(int, String). |
void com.hyphenate.chat.EMGroupManager.asyncChangeGroupDescription | ( | final String | groupId, |
final String | changedDescription, | ||
final EMCallBack | 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 EMCallBack#onSuccess(); if this call fails, calls EMCallBack#onError(int, String). |
void com.hyphenate.chat.EMGroupManager.asyncChangeGroupName | ( | final String | groupId, |
final String | changedGroupName, | ||
final EMCallBack | 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 EMCallBack#onSuccess(); if this call fails, calls EMCallBack#onError(int, String). |
void com.hyphenate.chat.EMGroupManager.asyncChangeOwner | ( | final String | groupId, |
final String | newOwner, | ||
final EMValueCallBack< EMGroup > | 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 EMValueCallBack#onSuccess(Object) and returns the updated group instance; if this call fails, calls EMValueCallBack#onError(int, String). |
void com.hyphenate.chat.EMGroupManager.asyncCreateGroup | ( | final String | groupName, |
final String | desc, | ||
final String[] | allMembers, | ||
final String | reason, | ||
final EMGroupOptions | option, | ||
final EMValueCallBack< EMGroup > | 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 com.hyphenate.EMMultiDeviceListener to listen on the event. The event callback function is com.hyphenate.EMMultiDeviceListener#onGroupEvent(int, String, List), where the first parameter is the event, for example, com.hyphenate.EMMultiDeviceListener#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 EMGroupOptions. The options are as follows:
|
callback | The completion callback. If this call succeeds, calls EMValueCallBack#onSuccess(Object) and returns the created group object; If this call fails, calls EMValueCallBack#onError(int, String). |
void com.hyphenate.chat.EMGroupManager.asyncDeclineApplication | ( | final String | username, |
final String | groupId, | ||
final String | reason, | ||
final EMCallBack | 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 EMCallBack#onSuccess(); if this call fails, calls EMCallBack#onError(int, String). |
void com.hyphenate.chat.EMGroupManager.asyncDeclineInvitation | ( | final String | groupId, |
final String | inviter, | ||
final String | reason, | ||
final EMCallBack | 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 EMCallBack#onSuccess(); if this call fails, calls EMCallBack#onError(int, String). |
void com.hyphenate.chat.EMGroupManager.asyncDeleteGroupSharedFile | ( | final String | groupId, |
final String | fileId, | ||
final EMCallBack | 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 EMCallBack#onSuccess(); if this call fails, calls EMCallBack#onError(int, String). |
void com.hyphenate.chat.EMGroupManager.asyncDestroyGroup | ( | final String | groupId, |
final EMCallBack | 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 EMCallBack#onSuccess(); if this call fails, calls EMCallBack#onError(int, String). |
void com.hyphenate.chat.EMGroupManager.asyncDownloadGroupSharedFile | ( | final String | groupId, |
final String | fileId, | ||
final String | savePath, | ||
final EMCallBack | callBack | ||
) |
Downloads the shared file of the group. For synchronous method, see downloadGroupSharedFile(String, String, String, EMCallBack).
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 EMCallBack#onSuccess(); if this call fails, calls EMCallBack#onError(int, String). Calls EMCallBack#onProgress(int, String) to view the file download progress. |
void com.hyphenate.chat.EMGroupManager.asyncFetchGroupAnnouncement | ( | final String | groupId, |
final EMValueCallBack< 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 EMValueCallBack#onSuccess(Object); if this call fails, calls EMValueCallBack#onError(int, String). |
void com.hyphenate.chat.EMGroupManager.asyncFetchGroupBlackList | ( | final String | groupId, |
final int | pageNum, | ||
final int | pageSize, | ||
final EMValueCallBack< 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 EMValueCallBack#onSuccess(Object) and returns the group blocklist on the next page; if this call fails, calls EMValueCallBack#onError(int, String). |
void com.hyphenate.chat.EMGroupManager.asyncFetchGroupMemberAllAttributes | ( | String | groupId, |
String | userId, | ||
EMValueCallBack< 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 EMValueCallBack#onSuccess(Object); if this call fails, calls EMValueCallBack#onError(int, String). |
void com.hyphenate.chat.EMGroupManager.asyncFetchGroupMembers | ( | final String | groupId, |
final String | cursor, | ||
final int | pageSize, | ||
final EMValueCallBack< EMCursorResult< 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 EMValueCallBack#onSuccess(Object) and returns the result of EMCursorResult, 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 EMValueCallBack#onError(int, String). |
void com.hyphenate.chat.EMGroupManager.asyncFetchGroupMembersAttributes | ( | String | groupId, |
List< String > | userList, | ||
List< String > | keyList, | ||
EMValueCallBack< 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 EMValueCallBack#onSuccess(Object); if this call fails, calls EMValueCallBack#onError(int, String). |
void com.hyphenate.chat.EMGroupManager.asyncFetchGroupMuteList | ( | final String | groupId, |
final int | pageNum, | ||
final int | pageSize, | ||
final EMValueCallBack< 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 EMValueCallBack#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 EMValueCallBack#onError(int, String). |
void com.hyphenate.chat.EMGroupManager.asyncFetchGroupSharedFileList | ( | final String | groupId, |
final int | pageNum, | ||
final int | pageSize, | ||
final EMValueCallBack< List< EMMucSharedFile > > | 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 EMValueCallBack#onSuccess(Object) and returns the shared files; if this call fails, calls EMValueCallBack#onError(int, String). |
Note the following:
void com.hyphenate.chat.EMGroupManager.asyncGetBlockedUsers | ( | final String | groupId, |
final EMValueCallBack< 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 EMValueCallBack#onSuccess(Object); if this call fails, calls EMValueCallBack#onError(int, String). |
void com.hyphenate.chat.EMGroupManager.asyncGetBlockedUsers | ( | final String | groupId, |
final int | pageIndex, | ||
final int | pageSize, | ||
final EMValueCallBack< 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 EMValueCallBack#onSuccess(Object) and returns the group blocklist; if this call fails, calls EMValueCallBack#onError(int, String). |
void com.hyphenate.chat.EMGroupManager.asyncGetGroupFromServer | ( | final String | groupId, |
final EMValueCallBack< EMGroup > | 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 EMCallBack#onSuccess(); if this call fails, calls EMCallBack#onError(int, String). |
void com.hyphenate.chat.EMGroupManager.asyncGetJoinedGroupsCountFromServer | ( | final EMValueCallBack< 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 EMValueCallBack#onSuccess(Object) and returns the group count if this call fails, calls EMValueCallBack#onError(int, String); |
void com.hyphenate.chat.EMGroupManager.asyncGetJoinedGroupsFromServer | ( | final EMValueCallBack< List< EMGroup > > | 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 EMValueCallBack#onSuccess(Object) and returns the list of groups that the user has joined; if the call fails, calls EMValueCallBack#onError(int, String). |
void com.hyphenate.chat.EMGroupManager.asyncGetJoinedGroupsFromServer | ( | final int | pageIndex, |
final int | pageSize, | ||
boolean | needMemberCount, | ||
boolean | needRole, | ||
final EMValueCallBack< List< EMGroup > > | 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 EMValueCallBack#onSuccess(Object) and returns the group list on the next page; if this call fails, calls EMValueCallBack#onError(int, String); |
void com.hyphenate.chat.EMGroupManager.asyncGetJoinedGroupsFromServer | ( | final int | pageIndex, |
final int | pageSize, | ||
final EMValueCallBack< List< EMGroup > > | 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 EMValueCallBack#onSuccess(Object) and returns the group list on the next page; if this call fails, calls EMValueCallBack#onError(int, String); |
void com.hyphenate.chat.EMGroupManager.asyncGetPublicGroupsFromServer | ( | final int | pageSize, |
final String | cursor, | ||
final EMValueCallBack< EMCursorResult< EMGroupInfo > > | 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 EMValueCallBack#onSuccess(Object) and returns the result of EMCursorResult), 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 EMValueCallBack#onError(int, String). |
void com.hyphenate.chat.EMGroupManager.asyncInviteUser | ( | final String | groupId, |
final String[] | beInvitedUsernames, | ||
final String | reason, | ||
final EMCallBack | callback | ||
) |
Invites users to join a group. Note: The group style is EMGroupStyle#EMGroupStylePrivateMemberCanInvite, 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 EMCallBack#onSuccess(); if this call fails, calls EMCallBack#onError(int, String). |
void com.hyphenate.chat.EMGroupManager.asyncJoinGroup | ( | final String | groupId, |
final EMCallBack | 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 EMGroupStyle. 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 EMCallBack#onSuccess(); if this call fails, calls EMCallBack#onError(int, String). |
void com.hyphenate.chat.EMGroupManager.asyncLeaveGroup | ( | final String | groupId, |
final EMCallBack | callback | ||
) |
Leaves a group.
This is an asynchronous method.
groupId | The group ID. |
callback | The completion callback. If this call succeeds, calls EMCallBack#onSuccess(); If this call fails, calls EMCallBack#onError(int, String). |
void com.hyphenate.chat.EMGroupManager.asyncMuteGroupMembers | ( | final String | groupId, |
final List< String > | muteMembers, | ||
final long | duration, | ||
final EMValueCallBack< EMGroup > | 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 EMValueCallBack#onSuccess(Object) and returns the updated group instance; If this call fails, calls EMValueCallBack#onError(int, String). |
void com.hyphenate.chat.EMGroupManager.asyncRemoveGroupAdmin | ( | final String | groupId, |
final String | admin, | ||
final EMValueCallBack< EMGroup > | 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 EMValueCallBack#onSuccess(Object) and returns the updated group instance; if this call succeeds, calls EMValueCallBack#onError(int, String). |
void com.hyphenate.chat.EMGroupManager.asyncRemoveUserFromGroup | ( | final String | groupId, |
final String | username, | ||
final EMCallBack | 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 EMCallBack#onSuccess(); if this call fails, calls EMCallBack#onError(int, String). |
void com.hyphenate.chat.EMGroupManager.asyncRemoveUsersFromGroup | ( | final String | groupId, |
final List< String > | members, | ||
final EMCallBack | 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 EMCallBack#onSuccess(); if this call fails, calls EMCallBack#onError(int, String). |
void com.hyphenate.chat.EMGroupManager.asyncSetGroupMemberAttributes | ( | String | groupId, |
String | userId, | ||
Map< String, String > | attributeMap, | ||
EMCallBack | 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 EMCallBack#onSuccess(); if this call fails, calls EMCallBack#onError(int, String). |
void com.hyphenate.chat.EMGroupManager.asyncUnblockGroupMessage | ( | final String | groupId, |
final EMCallBack | 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 EMCallBack#onSuccess(); if this call fails, calls EMCallBack#onError(int, String). |
void com.hyphenate.chat.EMGroupManager.asyncUnblockUser | ( | final String | groupId, |
final String | username, | ||
final EMCallBack | 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 EMCallBack#onSuccess(); if this call fails, calls EMCallBack#onError(int, String). |
void com.hyphenate.chat.EMGroupManager.asyncUnblockUsers | ( | final String | groupId, |
final List< String > | members, | ||
final EMCallBack | 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 EMCallBack#onSuccess(); if this call fails, calls EMCallBack#onError(int, String). |
void com.hyphenate.chat.EMGroupManager.asyncUnMuteGroupMembers | ( | final String | groupId, |
final List< String > | members, | ||
final EMValueCallBack< EMGroup > | 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 EMValueCallBack#onSuccess(Object) and returns the updated group instance; if this call fails, calls EMValueCallBack#onError(int, String). |
void com.hyphenate.chat.EMGroupManager.asyncUpdateGroupAnnouncement | ( | final String | groupId, |
final String | announcement, | ||
final EMCallBack | 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 EMCallBack#onSuccess(); if this call fails, calls EMCallBack#onError(int, String). |
void com.hyphenate.chat.EMGroupManager.asyncUploadGroupSharedFile | ( | final String | groupId, |
final String | filePath, | ||
final EMCallBack | callBack | ||
) |
Uploads the shared file to the group.
For the synchronous method, see uploadGroupSharedFile(String, String, EMCallBack).
This is an asynchronous method.
groupId | The group ID. |
filePath | The local file path. |
callBack | The completion callback. If this call succeeds, calls EMCallBack#onSuccess(); if this call fails, calls EMCallBack#onError(int, String). Calls EMCallBack#onSuccess() to view the upload progress. @Deprecated Deprecated. Please use asyncUploadGroupSharedFile(String, String, EMValueCallBack) instead. |
void com.hyphenate.chat.EMGroupManager.asyncUploadGroupSharedFile | ( | final String | groupId, |
final String | filePath, | ||
final EMValueCallBack< EMMucSharedFile > | callBack | ||
) |
Uploads the shared file to the group.
For the synchronous method, see uploadGroupSharedFile(String, String, EMCallBack).
This is an asynchronous method.
groupId | The group ID. |
filePath | The local file path. |
callBack | The completion callback. If this call succeeds, calls EMValueCallBack#onSuccess(Object); if this call fails, calls EMValueCallBack#onError(int, String). Calls EMValueCallBack#onSuccess(Object) to view the upload progress. |
void com.hyphenate.chat.EMGroupManager.blockGroupMessage | ( | String | groupId | ) | throws HyphenateException |
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, EMCallBack).
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
HyphenateException | A description of the exception. See EMError. |
void com.hyphenate.chat.EMGroupManager.blockUser | ( | String | groupId, |
String | username | ||
) | throws HyphenateException |
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, EMCallBack).
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
username | The user to be added to the blocklist. |
HyphenateException | A description of the exception. See EMError. |
void com.hyphenate.chat.EMGroupManager.blockUsers | ( | String | groupId, |
List< String > | members | ||
) | throws HyphenateException |
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, EMCallBack).
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. |
HyphenateException | A description of the exception. See EMError. |
void com.hyphenate.chat.EMGroupManager.changeGroupDescription | ( | String | groupId, |
String | changedDescription | ||
) | throws HyphenateException |
Changes the group description. Only the group owner or admin can call this method. For the asynchronous method, see asyncChangeGroupDescription(String, String, EMCallBack).
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
changedDescription | The new group description. |
HyphenateException | A description of the exception. See EMError. |
void com.hyphenate.chat.EMGroupManager.changeGroupName | ( | String | groupId, |
String | changedGroupName | ||
) | throws HyphenateException |
Changes the group name. Only the group owner or admin can call this method. For the asynchronous method, see asyncChangeGroupName(String, String, EMCallBack).
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. |
HyphenateException | A description of the exception. See EMError. |
EMGroup com.hyphenate.chat.EMGroupManager.changeOwner | ( | String | groupId, |
String | newOwner | ||
) | throws HyphenateException |
Transfers the group ownership. Only the group owner can call this method. For the asynchronous method, see asyncChangeOwner(String, String, EMValueCallBack).
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
newOwner | The new owner ID. |
HyphenateException | A description of the exception. See EMError. |
void com.hyphenate.chat.EMGroupManager.checkIfInGroupWhiteList | ( | final String | groupId, |
EMValueCallBack< 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 EMValueCallBack#onSuccess(Object) and returns a Boolean value to indicate whether the current user is on the group blocklist; if this call fails, calls EMValueCallBack#onError(int, String). |
void com.hyphenate.chat.EMGroupManager.cleanAllGroupsFromLocal | ( | ) |
Clear all local group details from the database and memory.
EMGroup com.hyphenate.chat.EMGroupManager.createGroup | ( | String | groupName, |
String | desc, | ||
String[] | allMembers, | ||
String | reason, | ||
EMGroupOptions | option | ||
) | throws HyphenateException |
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 com.hyphenate.EMMultiDeviceListener to listen on the event. The event callback function is com.hyphenate.EMMultiDeviceListener#onGroupEvent(int, String, List), where the first parameter is the event, for example, com.hyphenate.EMMultiDeviceListener#GROUP_CREATE for the group creation event. For the asynchronous method, see asyncCreateGroup(String, String, String[], String, EMGroupOptions, EMValueCallBack).
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 EMGroupOptions. The options are as follows:
|
HyphenateException | A description of the exception. See EMError. |
void com.hyphenate.chat.EMGroupManager.declineApplication | ( | String | username, |
String | groupId, | ||
String | reason | ||
) | throws HyphenateException |
Declines a group request. Only the group owner or admin can call this method. For the asynchronous method, see asyncDeclineApplication(String, String, String, EMCallBack).
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. |
HyphenateException | A description of the exception. See EMError. |
void com.hyphenate.chat.EMGroupManager.declineInvitation | ( | String | groupId, |
String | inviter, | ||
String | reason | ||
) | throws HyphenateException |
Declines a group invitation. For the asynchronous method, see asyncDeclineInvitation(String, String, String, EMCallBack).
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
inviter | The inviter. |
reason | The reason for declining. |
HyphenateException | A description of the exception. See EMError. |
void com.hyphenate.chat.EMGroupManager.deleteGroupSharedFile | ( | String | groupId, |
String | fileId | ||
) | throws HyphenateException |
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, EMCallBack).
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
fileId | The shared file ID. |
HyphenateException | Only the group owner or admin can call this method. See EMError. |
void com.hyphenate.chat.EMGroupManager.destroyGroup | ( | final String | groupId | ) | throws HyphenateException |
Destroys the group instance. Only the group owner can call this method. For the asynchronous method, see asyncDestroyGroup(String, EMCallBack).
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
HyphenateException | A description of the exception. See EMError. |
void com.hyphenate.chat.EMGroupManager.downloadGroupSharedFile | ( | String | groupId, |
String | fileId, | ||
String | savePath, | ||
EMCallBack | callBack | ||
) | throws HyphenateException |
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, EMCallBack).
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. |
HyphenateException | A description of the exception. See EMError. |
String com.hyphenate.chat.EMGroupManager.fetchGroupAnnouncement | ( | String | groupId | ) | throws HyphenateException |
Gets the group announcement from the server. Group members can call this method. For the asynchronous method, see asyncFetchGroupAnnouncement(String, EMValueCallBack).
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
HyphenateException | A description of the exception. See EMError. |
List< String > com.hyphenate.chat.EMGroupManager.fetchGroupBlackList | ( | String | groupId, |
int | pageNum, | ||
int | pageSize | ||
) | throws HyphenateException |
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, EMValueCallBack).
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. |
HyphenateException | A description of the exception. See EMError. |
EMCursorResult< String > com.hyphenate.chat.EMGroupManager.fetchGroupMembers | ( | String | groupId, |
String | cursor, | ||
int | pageSize | ||
) | throws HyphenateException |
Gets a group's member list with pagination. When EMCursorResult.getCursor() is an empty string ("") in the result, there is no more data. For the asynchronous method, see asyncFetchGroupMembers(String, String, int, EMValueCallBack).
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. |
HyphenateException | A description of the exception. See EMError |
Map< String, Long > com.hyphenate.chat.EMGroupManager.fetchGroupMuteList | ( | String | groupId, |
int | pageNum, | ||
int | pageSize | ||
) | throws HyphenateException |
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, EMValueCallBack).
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. |
HyphenateException | A description of the exception. See EMError. |
List< EMMucSharedFile > com.hyphenate.chat.EMGroupManager.fetchGroupSharedFileList | ( | String | groupId, |
int | pageNum, | ||
int | pageSize | ||
) | throws HyphenateException |
Gets the shared files of group from the server. For the asynchronous method, see asyncFetchGroupSharedFileList(String, int, int, EMValueCallBack).
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. |
HyphenateException | A description of the exception. See EMError. |
void com.hyphenate.chat.EMGroupManager.fetchGroupWhiteList | ( | final String | groupId, |
final EMValueCallBack< 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 EMValueCallBack#onSuccess(Object) and return the group blocklist; if this call fails, calls EMValueCallBack#onError(int, String). |
List< EMGroup > com.hyphenate.chat.EMGroupManager.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 > com.hyphenate.chat.EMGroupManager.getBlockedUsers | ( | String | groupId | ) | throws HyphenateException |
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, EMValueCallBack).
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
HyphenateException | A description of the exception. See EMError. |
List< String > com.hyphenate.chat.EMGroupManager.getBlockedUsers | ( | String | groupId, |
int | pageIndex, | ||
int | pageSize | ||
) | throws HyphenateException |
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, EMValueCallBack).
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. |
HyphenateException | A description of the exception. See EMError. |
EMGroup com.hyphenate.chat.EMGroupManager.getGroup | ( | String | groupId | ) |
Gets the group instance from the cache by group ID.
groupId | The group ID. |
EMGroup com.hyphenate.chat.EMGroupManager.getGroupFromServer | ( | String | groupId | ) | throws HyphenateException |
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, EMValueCallBack).
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
HyphenateException | A description of the exception. See EMError. |
EMGroup com.hyphenate.chat.EMGroupManager.getGroupFromServer | ( | String | groupId, |
boolean | fetchMembers | ||
) | throws HyphenateException |
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. |
HyphenateException | A description of the exception. See EMError. |
synchronized List< EMGroup > com.hyphenate.chat.EMGroupManager.getJoinedGroupsFromServer | ( | ) | throws HyphenateException |
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(EMValueCallBack).
This is a synchronous method and blocks the current thread.
HyphenateException | A description of the exception. See EMError. |
synchronized List< EMGroup > com.hyphenate.chat.EMGroupManager.getJoinedGroupsFromServer | ( | int | pageIndex, |
int | pageSize | ||
) | throws HyphenateException |
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, EMValueCallBack).
This is a synchronous method and blocks the current thread.
pageIndex | The page number, starting from 1. |
pageSize | The number of groups per page. |
HyphenateException | A description of the exception. See EMError. |
synchronized List< EMGroup > com.hyphenate.chat.EMGroupManager.getJoinedGroupsFromServer | ( | int | pageIndex, |
int | pageSize, | ||
boolean | needMemberCount, | ||
boolean | needRole | ||
) | throws HyphenateException |
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, EMValueCallBack).
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. |
HyphenateException | A description of the exception. See EMError. |
EMCursorResult< EMGroupInfo > com.hyphenate.chat.EMGroupManager.getPublicGroupsFromServer | ( | int | pageSize, |
String | cursor | ||
) | throws HyphenateException |
Gets public groups from the server with pagination. For the asynchronous method, see asyncGetPublicGroupsFromServer(int, String, EMValueCallBack).
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. |
HyphenateException | A description of the exception. See EMError. |
void com.hyphenate.chat.EMGroupManager.inviteUser | ( | String | groupId, |
String[] | beInvitedUsernames, | ||
String | reason | ||
) | throws HyphenateException |
Invites users to join a group. Note: The group style is EMGroupStyle#EMGroupStylePrivateMemberCanInvite, which allows group members to invite users. For the asynchronous method, see asyncInviteUser(String, String[], String, EMCallBack).
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. |
HyphenateException | A description of the exception. See EMError. |
void com.hyphenate.chat.EMGroupManager.joinGroup | ( | String | groupId | ) | throws HyphenateException |
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 EMGroupStyle. For the asynchronous method, see asyncJoinGroup(String, EMCallBack).
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
HyphenateException | A description of the exception. See EMError. |
void com.hyphenate.chat.EMGroupManager.leaveGroup | ( | String | groupId | ) | throws HyphenateException |
Leaves a group.
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
HyphenateException | A description of the exception. See EMError. |
synchronized void com.hyphenate.chat.EMGroupManager.loadAllGroups | ( | ) |
Loads all local groups from the database.
void com.hyphenate.chat.EMGroupManager.muteAllMembers | ( | final String | groupId, |
final EMValueCallBack< EMGroup > | 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 EMValueCallBack#onSuccess(Object) and returns the updated group instance; if this call fails, calls EMValueCallBack#onError(int, String). |
EMGroup com.hyphenate.chat.EMGroupManager.muteGroupMembers | ( | String | groupId, |
List< String > | muteMembers, | ||
long | duration | ||
) | throws HyphenateException |
Mutes group members. Only the group owner or admin can call this method. For the asynchronous method, see asyncMuteGroupMembers(String, List, long, EMValueCallBack).
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. |
HyphenateException | A description of the exception. See EMError. |
void com.hyphenate.chat.EMGroupManager.removeFromGroupWhiteList | ( | final String | groupId, |
final List< String > | members, | ||
final EMCallBack | 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 EMCallBack#onSuccess(); if this call fails, calls EMCallBack#onError(int, String). |
EMGroup com.hyphenate.chat.EMGroupManager.removeGroupAdmin | ( | String | groupId, |
String | admin | ||
) | throws HyphenateException |
Removes a group admin. Only the group owner can call this method. For the asynchronous method, see asyncRemoveGroupAdmin(String, String, EMValueCallBack).
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
admin | The admin ID to remove. |
HyphenateException | A description of the exception. See EMError. |
void com.hyphenate.chat.EMGroupManager.removeGroupChangeListener | ( | EMGroupChangeListener | listener | ) |
Removes a group change listener. This method removes a group change listener registered with addGroupChangeListener(EMGroupChangeListener).
listener | The group event listener to be removed. |
void com.hyphenate.chat.EMGroupManager.removeUserFromGroup | ( | final String | groupId, |
final String | username | ||
) | throws HyphenateException |
Removes a member from the group. Only the group owner or admin can call this method. For the asynchronous method, see asyncRemoveUserFromGroup(String, String, EMCallBack).
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
username | The user ID of the member to be removed. |
HyphenateException | A description of the exception. See EMError. |
void com.hyphenate.chat.EMGroupManager.removeUsersFromGroup | ( | final String | groupId, |
final List< String > | members | ||
) | throws HyphenateException |
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. |
HyphenateException | A description of the exception. See EMError. |
void com.hyphenate.chat.EMGroupManager.unblockGroupMessage | ( | String | groupId | ) | throws HyphenateException |
Unblocks group messages. For the asynchronous method, see asyncUnblockGroupMessage(String, EMCallBack).
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
HyphenateException | A description of the exception. See EMError. |
void com.hyphenate.chat.EMGroupManager.unblockUser | ( | String | groupId, |
String | username | ||
) | throws HyphenateException |
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, EMCallBack).
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
username | The user to be removed from the group blocklist. |
HyphenateException | A description of the exception. See EMError. |
void com.hyphenate.chat.EMGroupManager.unblockUsers | ( | String | groupId, |
List< String > | members | ||
) | throws HyphenateException |
Removes users from the group blocklist. Only the group owner or admin can call this method. For the asynchronous method, see asyncBlockUsers(String, List, EMCallBack).
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
members | The users to be removed from the group blocklist. |
HyphenateException | A description of the exception. See EMError. |
void com.hyphenate.chat.EMGroupManager.unmuteAllMembers | ( | final String | groupId, |
final EMValueCallBack< EMGroup > | 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 EMValueCallBack#onSuccess(Object) and returns the updated group instance; if this call fails, calls EMValueCallBack#onError(int, String). |
EMGroup com.hyphenate.chat.EMGroupManager.unMuteGroupMembers | ( | String | groupId, |
List< String > | members | ||
) | throws HyphenateException |
Unmutes group members. Only the group owner or admin can call this method. For the asynchronous method, see asyncUnMuteGroupMembers(String, List, EMValueCallBack).
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
members | The list of members to be muted. |
HyphenateException | A description of the exception. See EMError. |
void com.hyphenate.chat.EMGroupManager.updateGroupAnnouncement | ( | String | groupId, |
String | announcement | ||
) | throws HyphenateException |
Updates the group announcement. Only the group owner or admin can call this method. For the asynchronous method, see asyncUpdateGroupAnnouncement(String, String, EMCallBack).
This is a synchronous method and blocks the current thread.
groupId | The group ID. |
announcement | The group announcement. |
HyphenateException | A description of the exception. See EMError. |
EMGroup com.hyphenate.chat.EMGroupManager.updateGroupExtension | ( | String | groupId, |
String | extension | ||
) | throws HyphenateException |
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. |
HyphenateException | A description of the exception. See EMError. |
EMMucSharedFile com.hyphenate.chat.EMGroupManager.uploadGroupSharedFile | ( | String | groupId, |
String | filePath, | ||
EMCallBack | callBack | ||
) | throws HyphenateException |
Uploads the shared file to the group. Note: The callback is only used for progress callback. For the asynchronous method, see asyncUploadGroupSharedFile(String, String, EMValueCallBack).
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. |
HyphenateException | A description of the exception. See EMError. |