hyphenate_SDK3.0  3.8.5
hyphenatejavaIMSDK
Classes | Public Member Functions | List of all members
com.hyphenate.chat.EMGroupManager Class Reference

Classes

enum  EMGroupStyle
 

Public Member Functions

List< EMGroupgetAllGroups ()
 
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< EMGroupgetJoinedGroupsFromServer () throws HyphenateException
 
synchronized List< EMGroupgetJoinedGroupsFromServer (int pageIndex, int pageSize) throws HyphenateException
 
void asyncGetJoinedGroupsFromServer (final EMValueCallBack< List< EMGroup >> callback)
 
void asyncGetJoinedGroupsFromServer (final int pageIndex, final int pageSize, final EMValueCallBack< List< EMGroup >> callback)
 
EMCursorResult< EMGroupInfogetPublicGroupsFromServer (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 aysncMuteGroupMembers (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)
 
List< EMMucSharedFilefetchGroupSharedFileList (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)
 
EMGroup updateGroupExtension (String groupId, String extension) throws HyphenateException
 

Detailed Description

Group management is used to manage group creation, deletion, member management and other operations

Member Function Documentation

void com.hyphenate.chat.EMGroupManager.acceptApplication ( String  username,
String  groupId 
) throws HyphenateException

Accept the application of the user to join this group Owner or administrator‘s authority is required Asynchronously method see asyncAcceptApplication(String, String, EMCallBack)

Synchronization method will block the current thread

Parameters
usernameApplication user
groupIdGroup id for application
Exceptions
HyphenateExceptionError info, see EMError
EMGroup com.hyphenate.chat.EMGroupManager.acceptInvitation ( String  groupId,
String  inviter 
) throws HyphenateException

Accept group's invitation Asynchronously method see asyncAcceptInvitation(String, String, EMValueCallBack)

Synchronization method will block the current thread

Parameters
groupIdGroup ID
inviterInviter
Returns
The group user has accepted.
Exceptions
HyphenateExceptionError info, see EMError
EMGroup com.hyphenate.chat.EMGroupManager.addGroupAdmin ( final String  groupId,
final String  admin 
) throws HyphenateException

Add group admin Owner‘s authority is required, admin has no authority Asynchronously method see asyncAddGroupAdmin(String, String, EMValueCallBack)

Synchronization method will block the current thread

Parameters
groupIdGroup id
adminThe admin id to add
Returns
Return the updated group instance
Exceptions
HyphenateExceptionError info, see EMError
void com.hyphenate.chat.EMGroupManager.addGroupChangeListener ( EMGroupChangeListener  listener)

Register the group change listener After registering, need use removeGroupChangeListener(EMGroupChangeListener) to unregister

Parameters
listenerListener of group event to register
void com.hyphenate.chat.EMGroupManager.addToGroupWhiteList ( final String  groupId,
final List< String >  members,
final EMCallBack  callBack 
)

Add members to whitelist Owner or administrator‘s authority is required

Asynchronously method

Parameters
groupIdGroup id
membersMember list to add to whitelist
callBackResult callback, success call EMCallBack#onSuccess(), failure call EMCallBack#onError(int, String)
void com.hyphenate.chat.EMGroupManager.addUsersToGroup ( String  groupId,
String[]  newmembers 
) throws HyphenateException

Add users to the group Owner or administrator‘s authority is required Asynchronously method see asyncAddUsersToGroup(String, String[], EMCallBack)

Synchronization method will block the current thread

Parameters
groupIdGroup id
newmembersArray of new members to add
Exceptions
HyphenateExceptionError info, see EMError
void com.hyphenate.chat.EMGroupManager.addUsersToGroup ( String  groupId,
String[]  newmembers,
String  welcomeMessage 
) throws HyphenateException

Add users to the group Owner or administrator‘s authority is required Asynchronously method see asyncAddUsersToGroup(String, String[], EMCallBack)

Synchronization method will block the current thread

Parameters
groupIdGroup id
newmembersArray of new members to add
welcomeMessagewelcome message
Exceptions
HyphenateExceptionError info, see EMError
void com.hyphenate.chat.EMGroupManager.applyJoinToGroup ( String  groupId,
String  reason 
) throws HyphenateException

Apply to join the group Note: Group style is EMGroupStyle#EMGroupStylePublicJoinNeedApproval, which is the public group need to verify Asynchronously method see asyncApplyJoinToGroup(String, String, EMCallBack)

Synchronization method will block the current thread

Parameters
groupIdGroup id
reasonMessage for join application
Exceptions
HyphenateExceptionError info, see EMError
void com.hyphenate.chat.EMGroupManager.asyncAcceptApplication ( final String  username,
final String  groupId,
final EMCallBack  callback 
)

Accept the application of the user to join this group Owner or administrator‘s authority is required Synchronization method see acceptApplication(String, String)

Asynchronously method

Parameters
usernameApplication user
groupIdGroup id for application
callbackResult callback, success call EMCallBack#onSuccess(), failure call EMCallBack#onError(int, String)
void com.hyphenate.chat.EMGroupManager.asyncAcceptInvitation ( final String  groupId,
final String  inviter,
final EMValueCallBack< EMGroup callback 
)

Accept group's invitation Synchronization method see acceptInvitation(String, String)

Asynchronously method

Parameters
groupIdGroup ID
inviterInviter
callbackResult callback, success call EMValueCallBack#onSuccess(Object), return the updated group instance; Failure call EMValueCallBack#onError(int, String)
void com.hyphenate.chat.EMGroupManager.asyncAddGroupAdmin ( final String  groupId,
final String  admin,
final EMValueCallBack< EMGroup callback 
)

Add group admin Owner‘s authority is required, admin has no authority Synchronization method see addGroupAdmin(String, String)

Asynchronously method

Parameters
groupIdGroup id
adminNew owner id
callbackResult callback, success call EMValueCallBack#onSuccess(Object), return the updated group instance; Failure call EMValueCallBack#onError(int, String)
void com.hyphenate.chat.EMGroupManager.asyncAddUsersToGroup ( final String  groupId,
final String[]  newmembers,
final EMCallBack  callback 
)

Add users to the group Owner or administrator‘s authority is required Synchronization method see addUsersToGroup(String, String[])

Asynchronously method

Parameters
groupIdGroup id
newmembersArray of new members to add
callbackResult callback, success call EMCallBack#onSuccess(), failure call EMCallBack#onError(int, String)
void com.hyphenate.chat.EMGroupManager.asyncApplyJoinToGroup ( final String  groupId,
final String  reason,
final EMCallBack  callback 
)

Apply to join the group Note: Group style is EMGroupStyle#EMGroupStylePublicJoinNeedApproval, which is the public group need to verify Synchronization method see applyJoinToGroup(String, String)

Asynchronously method

Parameters
groupIdGroup id
reasonMessage for join application
callbackResult callback, success call EMCallBack#onSuccess(), failure call EMCallBack#onError(int, String)
void com.hyphenate.chat.EMGroupManager.asyncBlockGroupMessage ( final String  groupId,
final EMCallBack  callback 
)

Set to disable receiving the group messages Current user is still group member, but no longer receives group message Synchronization method see blockGroupMessage(String)

Asynchronously method

Parameters
groupIdGroup id
callbackResult callback, success call EMCallBack#onSuccess(), failure call EMCallBack#onError(int, String)
void com.hyphenate.chat.EMGroupManager.asyncBlockUser ( final String  groupId,
final String  username,
final EMCallBack  callback 
)

Add user to group blacklist Set to block member who can not join group again and will be not allowed to receive any group messages Owner or administrator‘s authority is required Synchronization method see blockUser(String, String)

After v3.3.0: Member who be added to blacklist will be removed to group first, then add to blacklist; The previous version is not the action to remove from group

Asynchronously method

Parameters
groupIdGroup id
usernameUser to be blocked
callbackResult callback, success call EMCallBack#onSuccess(), failure call EMCallBack#onError(int, String)
void com.hyphenate.chat.EMGroupManager.asyncBlockUsers ( final String  groupId,
final List< String >  members,
final EMCallBack  callback 
)

Add users to group blacklist Set to block members who can not join group again and will be not allowed to receive any group messages Owner or administrator‘s authority is required Synchronization method see blockUsers(String, List)

After v3.3.0: Members who be added to blacklist will be removed to group first, then add to blacklist; The previous version is not the action to remove from group

Asynchronously method

Parameters
groupIdGroup id
membersUsers to be blocked
callbackResult callback, success call EMCallBack#onSuccess(), failure call EMCallBack#onError(int, String)
void com.hyphenate.chat.EMGroupManager.asyncChangeGroupDescription ( final String  groupId,
final String  changedDescription,
final EMCallBack  callBack 
)

Change group description. ONLY the group own can change group description Owner or administrator‘s authority is required Synchronization method see changeGroupDescription(String, String)

Asynchronously method

Parameters
groupIdGroup id
changedDescriptionChanged group description
callBackResult callback, success call EMCallBack#onSuccess(), failure call EMCallBack#onError(int, String)
void com.hyphenate.chat.EMGroupManager.asyncChangeGroupName ( final String  groupId,
final String  changedGroupName,
final EMCallBack  callback 
)

Change group name Owner or administrator‘s authority is required Synchronization method see changeGroupName(String, String)

Asynchronously method

Parameters
groupIdGroup id to be change name
changedGroupNameNew group name
callbackResult callback, success call EMCallBack#onSuccess(), failure call EMCallBack#onError(int, String)
void com.hyphenate.chat.EMGroupManager.asyncChangeOwner ( final String  groupId,
final String  newOwner,
final EMValueCallBack< EMGroup callback 
)

Transfer group ownership Owner‘s authority is required Synchronization method see changeOwner(String, String)

Asynchronously method

Parameters
groupIdGroup id
newOwnerNew Owner id
callbackResult callback, success call EMValueCallBack#onSuccess(Object), return the updated group instance; Failure call 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 
)

Create a group After group is successful created, the data in memory and database will be updated; Multi-device will receive the notification event and then update the data in memory and database. You can set com.hyphenate.EMMultiDeviceListener to monitor the event, the callback function is com.hyphenate.EMMultiDeviceListener#onGroupEvent(int, String, List), the first parameter is the event which is com.hyphenate.EMMultiDeviceListener#GROUP_CREATE

Asynchronously method

Parameters
groupNameGroup name, not necessary, pass null if not set
descGroup description, not necessary, pass null if not set
allMembersArray of members, no need include the owner of this group, not necessary, not null
reasonInvitation information when inviting members to join, not necessary, pass null if not set
optionOptions when creating a group, not necessary, not null. See EMGroupOptions Can set the following parameters: Maximum number of group members, default is 200; Group style, see EMGroupStyle, default is EMGroupStyle#EMGroupStylePrivateOnlyOwnerInvite; If it requires the content of invitee, default is false, invitee will auto join the group; Also can set group ext
callbackResult callback, success call EMValueCallBack#onSuccess(Object), return the EMGroup instance created successful failure call EMValueCallBack#onError(int, String)
void com.hyphenate.chat.EMGroupManager.asyncDeclineApplication ( final String  username,
final String  groupId,
final String  reason,
final EMCallBack  callback 
)

Decline the application of the user to join this group Owner or administrator‘s authority is required Synchronization method see declineApplication(String, String, String)

Asynchronously method

Parameters
usernameApplication user
groupIdGroup id for application
reasonMessage for decline
callbackResult callback, success call EMCallBack#onSuccess(), failure call EMCallBack#onError(int, String)
void com.hyphenate.chat.EMGroupManager.asyncDeclineInvitation ( final String  groupId,
final String  inviter,
final String  reason,
final EMCallBack  callback 
)

Decline group's invitation Synchronization method see declineInvitation(String, String, String)

Asynchronously method

Parameters
groupIdGroup ID
inviterInviter
reasonDeclining message
callbackResult callback, success call EMCallBack#onSuccess(), failure call EMCallBack#onError(int, String)
void com.hyphenate.chat.EMGroupManager.asyncDeleteGroupSharedFile ( final String  groupId,
final String  fileId,
final EMCallBack  callBack 
)

Delete file from group Members can delete their own uploaded files, and the group owner or group administrator can delete all shared files Synchronization method see deleteGroupSharedFile(String, String)

Asynchronously method

Parameters
groupIdGroup id
fileIdFile id
callBackResult callback, success call EMCallBack#onSuccess(), failure call EMCallBack#onError(int, String)
void com.hyphenate.chat.EMGroupManager.asyncDestroyGroup ( final String  groupId,
final EMCallBack  callback 
)

Destroy group Owner‘s authority is required Synchronization method see destroyGroup(String)

Asynchronously method

Parameters
groupIdGroup id
callbackResult callback, success call EMCallBack#onSuccess(), failure call EMCallBack#onError(int, String)
void com.hyphenate.chat.EMGroupManager.asyncDownloadGroupSharedFile ( final String  groupId,
final String  fileId,
final String  savePath,
final EMCallBack  callBack 
)

Download the file from group Synchronization method see downloadGroupSharedFile(String, String, String, EMCallBack)

Asynchronously method

Parameters
groupIdGroup id
fileIdFile id
savePathFile to saved path
callBackResult callback, success call EMCallBack#onSuccess(), failure call EMCallBack#onError(int, String)
void com.hyphenate.chat.EMGroupManager.asyncFetchGroupAnnouncement ( final String  groupId,
final EMValueCallBack< String >  callBack 
)

Get group announcement from server Group member‘s authority is required Synchronization method see fetchGroupAnnouncement(String)

Asynchronously method

Parameters
groupIdGroup id
callBackResult callback, success call EMValueCallBack#onSuccess(Object), failure call EMValueCallBack#onError(int, String)
void com.hyphenate.chat.EMGroupManager.asyncFetchGroupBlackList ( final String  groupId,
final int  pageNum,
final int  pageSize,
final EMValueCallBack< List< String >>  callBack 
)

Fetch group blacklist from server by page Owner or administrator‘s authority is required Synchronization method see fetchGroupBlackList(String, int, int)

Asynchronously method

Parameters
groupIdGroup id
pageNumPage number, start from 1
pageSizeSize to be fetched per page
callBackResult callback, success call EMValueCallBack#onSuccess(Object), return the group blacklist by page; Failure call EMValueCallBack#onError(int, String)
void com.hyphenate.chat.EMGroupManager.asyncFetchGroupMembers ( final String  groupId,
final String  cursor,
final int  pageSize,
final EMValueCallBack< EMCursorResult< String >>  callback 
)

Get group's member list by page Synchronization method see fetchGroupMembers(String, String, int)

Asynchronously method

Parameters
groupIdGroup id
cursorThe count fetched a time
pageSizeThe cursor position to fetch data, use null if first call
callbackResult callback, success call EMValueCallBack#onSuccess(Object), fetch result, see EMCursorResult, used to get next page and the group list, for the last page, EMCursorResult.getCursor() is an empty string. Failure call 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 
)

Fetch mute list Owner or administrator‘s authority is required Synchronization method see fetchGroupMuteList(String, int, int)

Asynchronously method

Parameters
groupIdGroup id
pageNumThe count fetched a time
pageSizeThe cursor position to fetch data
callBackResult callback, success call EMValueCallBack#onSuccess(Object), return a map which contains the mute member id and mute duration, in which the key of each entry is the mute member id and the value is the expired time of banning post action, in milli-seconds; Failure call EMValueCallBack#onError(int, String)
void com.hyphenate.chat.EMGroupManager.asyncFetchGroupSharedFileList ( final String  groupId,
final int  pageNum,
final int  pageSize,
final EMValueCallBack< List< EMMucSharedFile >>  callBack 
)

Get the shared file list from server Synchronization method see fetchGroupSharedFileList(String, int, int)

Asynchronously method

Parameters
groupIdGroup id
pageNumPage number, start from 1
pageSizeSize to be fetched per page
callBackResult callback, success call EMValueCallBack#onSuccess(Object), Return the shared files; Failure call EMValueCallBack#onError(int, String)
void com.hyphenate.chat.EMGroupManager.asyncGetBlockedUsers ( final String  groupId,
final EMValueCallBack< List< String >>  callback 
)

Get blacklist from server, default maximum is 200 Owner or administrator‘s authority is required Synchronization method see getBlockedUsers(String)

Asynchronously method

Parameters
groupIdGroup id
callbackResult callback, success call EMValueCallBack#onSuccess(Object), return the group's blacklist; Failure call EMValueCallBack#onError(int, String)
void com.hyphenate.chat.EMGroupManager.asyncGetBlockedUsers ( final String  groupId,
final int  pageIndex,
final int  pageSize,
final EMValueCallBack< List< String >>  callback 
)

Get black list of group by page Owner or administrator‘s authority is required Synchronization method see getBlockedUsers(String, int, int)

Asynchronously method

Parameters
groupIdGroup id
pageIndexPage number, start from 1
pageSizeSize to be fetched per page
callbackResult callback, success call EMValueCallBack#onSuccess(Object), return the group's blacklist; Failure call EMValueCallBack#onError(int, String)
void com.hyphenate.chat.EMGroupManager.asyncGetGroupFromServer ( final String  groupId,
final EMValueCallBack< EMGroup callback 
)

Get information of group from server Synchronization method see getGroupFromServer(String)

Asynchronously method

Parameters
groupIdGroup id
callbackResult callback, success call EMCallBack#onSuccess(), failure call EMCallBack#onError(int, String)
void com.hyphenate.chat.EMGroupManager.asyncGetJoinedGroupsFromServer ( final EMValueCallBack< List< EMGroup >>  callback)

Fetch all joined groups from server Only return the group list, not include member list in group, use getGroupFromServer(String groupId) if you want it Synchronization method see getJoinedGroupsFromServer()

Asynchronously method

Parameters
callbackResult callback, success call EMValueCallBack#onSuccess(Object), return the group list has joined; failure call EMValueCallBack#onError(int, String)
void com.hyphenate.chat.EMGroupManager.asyncGetJoinedGroupsFromServer ( final int  pageIndex,
final int  pageSize,
final EMValueCallBack< List< EMGroup >>  callback 
)

Fetch joined groups from server by page Only return the group list, not include member list in group getGroupFromServer(String groupId) if you want it Synchronization method see getJoinedGroupsFromServer(int, int)

Asynchronously method

Parameters
pageIndexPage number, start from 1
pageSizeSize to be fetched per page
callbackResult callback, success call EMValueCallBack#onSuccess(Object), return the group list by page; Failure call EMValueCallBack#onError(int, String)
void com.hyphenate.chat.EMGroupManager.asyncGetPublicGroupsFromServer ( final int  pageSize,
final String  cursor,
final EMValueCallBack< EMCursorResult< EMGroupInfo >>  callback 
)

Get public groups from server by page Synchronization method see getPublicGroupsFromServer(int, String)

Asynchronously method

Parameters
pageSizeThe count fetched a time
cursorThe cursor position to fetch data, use null if first call
callbackResult callback, success call EMValueCallBack#onSuccess(Object), return result, see EMCursorResult, used to get next page and the group list, for the last page, EMCursorResult.getCursor() is an empty string; failure call EMValueCallBack#onError(int, String)
void com.hyphenate.chat.EMGroupManager.asyncInviteUser ( final String  groupId,
final String[]  beInvitedUsernames,
final String  reason,
final EMCallBack  callback 
)

Invite other users to join the group Note: The group style is EMGroupStyle#EMGroupStylePrivateMemberCanInvite, which allow group members to invite users Synchronization method see inviteUser(String, String[], String)

Asynchronously method

Parameters
groupIdGroup id
beInvitedUsernamesArray of users to be invited
reasonMessage for invitation
callbackResult callback, success call EMCallBack#onSuccess(), failure call EMCallBack#onError(int, String)
void com.hyphenate.chat.EMGroupManager.asyncJoinGroup ( final String  groupId,
final EMCallBack  callback 
)

Join the group by the group id If group's style is EMGroupStyle#EMGroupStylePublicOpenJoin,join it not require owner agree; If is EMGroupStyle#EMGroupStylePublicJoinNeedApproval, need owner's agreement Synchronization method see joinGroup(String)

Asynchronously method

Parameters
groupIdGroup id
callbackResult callback, success call EMCallBack#onSuccess(), failure call EMCallBack#onError(int, String)
void com.hyphenate.chat.EMGroupManager.asyncLeaveGroup ( final String  groupId,
final EMCallBack  callback 
)

Current joined user exit group

Asynchronously method

Parameters
groupIdGroup id
callbackResult callback, success call EMCallBack#onSuccess(), failure call EMCallBack#onError(int, String)
void com.hyphenate.chat.EMGroupManager.asyncRemoveGroupAdmin ( final String  groupId,
final String  admin,
final EMValueCallBack< EMGroup callback 
)

Remove group administrator Owner‘s authority is required Synchronization method see removeGroupAdmin(String, String)

Asynchronously method

Parameters
groupIdGroup id
adminAdmin id to remove
callbackResult callback, success call EMValueCallBack#onSuccess(Object), return the updated group instance; Failure call EMValueCallBack#onError(int, String)
void com.hyphenate.chat.EMGroupManager.asyncRemoveUserFromGroup ( final String  groupId,
final String  username,
final EMCallBack  callback 
)

Remove member from group Owner or administrator‘s authority is required Synchronization method see removeUserFromGroup(String, String)

Asynchronously method

Parameters
groupIdGroup id
usernameUser id to be removed
callbackResult callback, success call EMCallBack#onSuccess(), failure call EMCallBack#onError(int, String)
void com.hyphenate.chat.EMGroupManager.asyncRemoveUsersFromGroup ( final String  groupId,
final List< String >  members,
final EMCallBack  callback 
)

Remove members from group Owner or administrator‘s authority is required Synchronization method see '

Asynchronously method

Parameters
groupIdGroup id
membersUser ids to be removed
callbackResult callback, success call EMCallBack#onSuccess(), failure call EMCallBack#onError(int, String)
void com.hyphenate.chat.EMGroupManager.asyncUnblockGroupMessage ( final String  groupId,
final EMCallBack  callback 
)

Set to enable to receive the group message again Synchronization method see unblockGroupMessage(String)

Asynchronously method

Parameters
groupIdGroup id
callbackResult callback, success call EMCallBack#onSuccess(), failure call EMCallBack#onError(int, String)
void com.hyphenate.chat.EMGroupManager.asyncUnblockUser ( final String  groupId,
final String  username,
final EMCallBack  callback 
)

Remove the blocked user from the group blacklist Owner or administrator‘s authority is required Synchronization method see unblockUser(String, String)

Asynchronously method

Parameters
groupIdGroup id
usernameUsername to remove from blacklist
callbackResult callback, success call EMCallBack#onSuccess(), failure call EMCallBack#onError(int, String)
void com.hyphenate.chat.EMGroupManager.asyncUnblockUsers ( final String  groupId,
final List< String >  members,
final EMCallBack  callback 
)

Remove the blocked users from the group blacklist Owner or administrator‘s authority is required Synchronization method see unblockUsers(String, List)

Asynchronously method

Parameters
groupIdGroup id
membersThe users to remove from blacklist
callbackResult callback, success call EMCallBack#onSuccess(), failure call EMCallBack#onError(int, String)
void com.hyphenate.chat.EMGroupManager.asyncUnMuteGroupMembers ( final String  groupId,
final List< String >  members,
final EMValueCallBack< EMGroup callback 
)

Unban the specified users Owner or administrator‘s authority is required Synchronization method see unMuteGroupMembers(String, List)

Asynchronously method

Parameters
groupIdGroup id
membersThe users to release mute
callbackResult callback, success call EMValueCallBack#onSuccess(Object), return the updated group instance; Failure call EMValueCallBack#onError(int, String)
void com.hyphenate.chat.EMGroupManager.asyncUpdateGroupAnnouncement ( final String  groupId,
final String  announcement,
final EMCallBack  callBack 
)

Update group announcement Owner or administrator‘s authority is required Synchronization method see updateGroupAnnouncement(String, String)

Asynchronously method

Parameters
groupIdGroup id
announcementGroup announcement
callBackResult callback, success call EMCallBack#onSuccess(), failure call EMCallBack#onError(int, String)
void com.hyphenate.chat.EMGroupManager.asyncUploadGroupSharedFile ( final String  groupId,
final String  filePath,
final EMCallBack  callBack 
)

Upload file to group Synchronization method see uploadGroupSharedFile(String, String, EMCallBack)

Asynchronously method

Parameters
groupIdGroup id
filePathFile local path
callBackResult callback, success call EMCallBack#onSuccess(), failure call EMCallBack#onError(int, String)
void com.hyphenate.chat.EMGroupManager.aysncMuteGroupMembers ( final String  groupId,
final List< String >  muteMembers,
final long  duration,
final EMValueCallBack< EMGroup callback 
)

Mute specified members from posting message for specified duration Owner or administrator‘s authority is required Synchronization method see muteGroupMembers(String, List, long)

Asynchronously method

Parameters
groupIdGroup id
muteMembersMute group members
durationMute duration, in milli-seconds
callbackResult callback, success call EMValueCallBack#onSuccess(Object), return the updated group instance; Failure call EMValueCallBack#onError(int, String)
void com.hyphenate.chat.EMGroupManager.blockGroupMessage ( String  groupId) throws HyphenateException

Set to disable receiving the group messages Current user is still group member, but no longer receives group message Asynchronously method see asyncBlockGroupMessage(String, EMCallBack)

Synchronization method will block the current thread

Parameters
groupIdGroup id
Exceptions
HyphenateExceptionError info, see EMError
void com.hyphenate.chat.EMGroupManager.blockUser ( String  groupId,
String  username 
) throws HyphenateException

Add user to group blacklist Set to block member who can not join group again and will be not allowed to receive any group messages Owner or administrator‘s authority is required Asynchronously method see asyncBlockUser(String, String, EMCallBack)

After v3.3.0: Member who be added to blacklist will be removed to group first, then add to blacklist; The previous version is not the action to remove from group

Synchronization method will block the current thread

Parameters
groupIdGroup id
usernameUser to be blocked
Exceptions
HyphenateExceptionError info, see EMError
void com.hyphenate.chat.EMGroupManager.blockUsers ( String  groupId,
List< String >  members 
) throws HyphenateException

Add users to group blacklist Set to block members who can not join group again and will be not allowed to receive any group messages Owner or administrator‘s authority is required Asynchronously method see asyncBlockUsers(String, List, EMCallBack)

After v3.3.0: Members who be added to blacklist will be removed to group first, then add to blacklist; The previous version is not the action to remove from group

Synchronization method will block the current thread

Parameters
groupIdGroup Id
membersUsers to be blocked
Exceptions
HyphenateExceptionError info, see EMError
void com.hyphenate.chat.EMGroupManager.changeGroupDescription ( String  groupId,
String  changedDescription 
) throws HyphenateException

Change group description Owner or administrator‘s authority is required Asynchronously method see asyncChangeGroupDescription(String, String, EMCallBack)

Synchronization method will block the current thread

Parameters
groupIdGroup id
changedDescriptionChanged group description
Exceptions
HyphenateExceptionError info, see EMError
void com.hyphenate.chat.EMGroupManager.changeGroupName ( String  groupId,
String  changedGroupName 
) throws HyphenateException

Change group name Owner or administrator‘s authority is required Asynchronously method see asyncChangeGroupName(String, String, EMCallBack)

Synchronization method will block the current thread

Parameters
groupIdGroup id to be change name
changedGroupNameNew group name
Exceptions
HyphenateExceptionError info, see EMError
EMGroup com.hyphenate.chat.EMGroupManager.changeOwner ( String  groupId,
String  newOwner 
) throws HyphenateException

Transfer group ownership Owner‘s authority is required Asynchronously method see asyncChangeOwner(String, String, EMValueCallBack)

Synchronization method will block the current thread

Parameters
groupIdGroup id
newOwnerNew owner id
Returns
Return the updated group instance
Exceptions
HyphenateExceptionError info, see EMError
void com.hyphenate.chat.EMGroupManager.checkIfInGroupWhiteList ( final String  groupId,
EMValueCallBack< Boolean >  callBack 
)

Check if current user in group whitelist

Asynchronously method

Parameters
groupIdGroup id
callBackResult callback, success call EMValueCallBack#onSuccess(Object), return the Boolean whether the current user is in group whitelist; Failure call EMValueCallBack#onError(int, String)
EMGroup com.hyphenate.chat.EMGroupManager.createGroup ( String  groupName,
String  desc,
String[]  allMembers,
String  reason,
EMGroupOptions  option 
) throws HyphenateException

Create a group After group is successful created, the data in memory and database will be updated; Multi-device will receive the notification event and then update the data in memory and database. You can set com.hyphenate.EMMultiDeviceListener to monitor the event, the callback function is com.hyphenate.EMMultiDeviceListener#onGroupEvent(int, String, List), the first parameter is the event which is com.hyphenate.EMMultiDeviceListener#GROUP_CREATE Asynchronously method see asyncCreateGroup(String, String, String[], String, EMGroupOptions, EMValueCallBack)

Synchronization method will block the current thread

Parameters
groupNameGroup name, not necessary, pass null if not set
descGroup description, not necessary, pass null if not set
allMembersArray of members, no need include the owner of this group, not necessary, not null
reasonInvitation information when inviting members to join, not necessary, pass null if not set
optionOptions when creating a group, not necessary, not null. See EMGroupOptions Can set the following parameters: Maximum number of group members, default is 200; Group style, see EMGroupStyle, default is EMGroupStyle#EMGroupStylePrivateOnlyOwnerInvite; If it requires the content of invitee, default is false, invitee will auto join the group; Also can set group ext
Returns
Return the EMGroup instance created successful
Exceptions
HyphenateExceptionError info, see com.hyphenate.EMError
void com.hyphenate.chat.EMGroupManager.declineApplication ( String  username,
String  groupId,
String  reason 
) throws HyphenateException

Decline the application of the user to join this group Owner or administrator‘s authority is required Asynchronously method see asyncDeclineApplication(String, String, String, EMCallBack)

Synchronization method will block the current thread

Parameters
usernameApplication user
groupIdGroup id for application
reasonMessage for decline
Exceptions
HyphenateExceptionError info, see EMError
void com.hyphenate.chat.EMGroupManager.declineInvitation ( String  groupId,
String  inviter,
String  reason 
) throws HyphenateException

Decline group's invitation Synchronization method see asyncDeclineInvitation(String, String, String, EMCallBack)

Synchronization method will block the current thread

Parameters
groupIdGroup ID
inviterInviter
reasonDeclining message
Exceptions
HyphenateExceptionError info, see EMError
void com.hyphenate.chat.EMGroupManager.deleteGroupSharedFile ( String  groupId,
String  fileId 
) throws HyphenateException

Delete file from group Members can delete their own uploaded files, and the group owner or group administrator can delete all shared files Asynchronously method see asyncDeleteGroupSharedFile(String, String, EMCallBack)

Synchronization method will block the current thread

Parameters
groupIdGroup id
fileIdFile id
Exceptions
HyphenateExceptionError info, see EMError
void com.hyphenate.chat.EMGroupManager.destroyGroup ( final String  groupId) throws HyphenateException

Destroy group Owner‘s authority is required Asynchronously method see asyncDestroyGroup(String, EMCallBack)

Synchronization method will block the current thread

Parameters
groupIdGroup id
Exceptions
HyphenateExceptionError info, see EMError
void com.hyphenate.chat.EMGroupManager.downloadGroupSharedFile ( String  groupId,
String  fileId,
String  savePath,
EMCallBack  callBack 
) throws HyphenateException

Download the file from group Note the callback only callback progress Asynchronously method see asyncDownloadGroupSharedFile(String, String, String, EMCallBack)

Synchronization method will block the current thread

Parameters
groupIdGroup id
fileIdFile id
savePathFile to saved path
callBackProgress callback to download file
Exceptions
HyphenateExceptionError info, see EMError
String com.hyphenate.chat.EMGroupManager.fetchGroupAnnouncement ( String  groupId) throws HyphenateException

Get group announcement from server Group member‘s authority is required Asynchronously method see asyncFetchGroupAnnouncement(String, EMValueCallBack)

Synchronization method will block the current thread

Parameters
groupIdGroup id
Returns
Group announcement
Exceptions
HyphenateExceptionError info, see EMError
List<String> com.hyphenate.chat.EMGroupManager.fetchGroupBlackList ( String  groupId,
int  pageNum,
int  pageSize 
) throws HyphenateException

Fetch group blacklist from server by page Owner or administrator‘s authority is required Asynchronously method see asyncFetchGroupBlackList(String, int, int, EMValueCallBack)

Synchronization method will block the current thread

Parameters
groupIdGroup id
pageNumPage number, start from 1
pageSizeSize to be fetched per page
Returns
Return the updated group instance
Exceptions
HyphenateExceptionError info, see EMError
EMCursorResult<String> com.hyphenate.chat.EMGroupManager.fetchGroupMembers ( String  groupId,
String  cursor,
int  pageSize 
) throws HyphenateException

Get group's member list by page When EMCursorResult.getCursor() is an empty string ("") in the result, there is no more data Asynchronously method see asyncFetchGroupMembers(String, String, int, EMValueCallBack)

Synchronization method will block the current thread

Parameters
groupIdGroup id
cursorThe count fetched a time
pageSizeThe cursor position to fetch data, use null if first call
Returns
Fetch result, see EMCursorResult, used to get next page and the group list, for the last page, EMCursorResult.getCursor() is an empty string.
Exceptions
HyphenateExceptionError info, see EMError
Map<String, Long> com.hyphenate.chat.EMGroupManager.fetchGroupMuteList ( String  groupId,
int  pageNum,
int  pageSize 
) throws HyphenateException

Fetch mute list Owner or administrator‘s authority is required Asynchronously method see asyncFetchGroupMuteList(String, int, int, EMValueCallBack)

Synchronization method will block the current thread

Parameters
groupIdGroup id
pageNumThe count fetched a time
pageSizeThe cursor position to fetch data
Returns
Return a map which contains the mute member id and mute duration, in which the key of each entry is the mute member id and the value is the expired time of banning post action, in milli-seconds
Exceptions
HyphenateExceptionError info, see EMError
List<EMMucSharedFile> com.hyphenate.chat.EMGroupManager.fetchGroupSharedFileList ( String  groupId,
int  pageNum,
int  pageSize 
) throws HyphenateException

Get the shared file list from server Asynchronously method see asyncFetchGroupSharedFileList(String, int, int, EMValueCallBack)

Synchronization method will block the current thread

Parameters
groupIdGroup id
pageNumPage number, start from 1
pageSizeSize to be fetched per page
Returns
Return the shared files
Exceptions
HyphenateExceptionError info, see EMError
void com.hyphenate.chat.EMGroupManager.fetchGroupWhiteList ( final String  groupId,
final EMValueCallBack< List< String >>  callBack 
)

Fetch group whitelist from serer Owner or administrator‘s authority is required

Asynchronously method

Parameters
groupIdGroup id
callBackResult callback, success call EMValueCallBack#onSuccess(Object), return the group whitelist; Failure call EMValueCallBack#onError(int, String)
List<EMGroup> com.hyphenate.chat.EMGroupManager.getAllGroups ( )

Get all groups from cache Before call this method, we suggest that you can call loadAllGroups() at the appropriate time to load the group data from the DB into memory; If have not called loadAllGroups(), this method will load data from database first and then load from cache

Returns
Group List
List<String> com.hyphenate.chat.EMGroupManager.getBlockedUsers ( String  groupId) throws HyphenateException

Fetch black list from server, default maximum is 200 Owner or administrator‘s authority is required Asynchronously method see asyncGetBlockedUsers(String, EMValueCallBack)

Synchronization method will block the current thread

Parameters
groupIdGroup id
Returns
List List of users in group blacklist, default maximum is 200
Exceptions
HyphenateExceptionError info, see EMError
List<String> com.hyphenate.chat.EMGroupManager.getBlockedUsers ( String  groupId,
int  pageIndex,
int  pageSize 
) throws HyphenateException

Get blacklist of group from server by page Owner or administrator‘s authority is required Asynchronously method see asyncGetBlockedUsers(String, int, int, EMValueCallBack)

Synchronization method will block the current thread

Parameters
groupIdGroup id
pageIndexPage number, start from 1
pageSizeSize to be fetched per page
Returns
List List of users in group blacklist by page
Exceptions
HyphenateExceptionError info, see EMError
EMGroup com.hyphenate.chat.EMGroupManager.getGroup ( String  groupId)

Get local group from cache by group id

Parameters
groupIdGroup id to get
Returns
Return EMGroup instance, return null if group is not exist
EMGroup com.hyphenate.chat.EMGroupManager.getGroupFromServer ( String  groupId) throws HyphenateException

Get information of group from server Do not get members, use fetchGroupMembers(String, String, int) if want ot get members Asynchronously method see asyncGetGroupFromServer(String, EMValueCallBack)

Synchronization method will block the current thread

Parameters
groupIdGroup id
Returns
EMGroup Return EMGroup instance
Exceptions
HyphenateExceptionError info, see EMError
EMGroup com.hyphenate.chat.EMGroupManager.getGroupFromServer ( String  groupId,
boolean  fetchMembers 
) throws HyphenateException

Get information of group from server When parameter of fetchMembers is true, fetch group members from server, maximum count is 200, if want to get more members, use fetchGroupMembers(String, String, int) Only members in group can get the member list of group

Synchronization method will block the current thread

Parameters
groupIdGroup id
fetchMembersWhether need fetch group members, if need fetch members, default action fetch 200 members
Returns
EMGroup Return EMGroup instance
Exceptions
HyphenateExceptionError info, see EMError
synchronized List<EMGroup> com.hyphenate.chat.EMGroupManager.getJoinedGroupsFromServer ( ) throws HyphenateException

Fetch all joined groups from server Only return the group list, not include member list in group, use getGroupFromServer(String groupId) if you want it Asynchronously method see asyncGetJoinedGroupsFromServer(EMValueCallBack)

Synchronization method will block the current thread

Returns
Group list of the current user has joined
Exceptions
HyphenateExceptionError info, see EMError
synchronized List<EMGroup> com.hyphenate.chat.EMGroupManager.getJoinedGroupsFromServer ( int  pageIndex,
int  pageSize 
) throws HyphenateException

Fetch joined groups from server by page Only return the group list, not include member list in group getGroupFromServer(String groupId) if you want it Asynchronously method see asyncGetJoinedGroupsFromServer(int, int, EMValueCallBack)

Synchronization method will block the current thread

Parameters
pageIndexPage number, start from 1
pageSizeSize to be fetched per page
Returns
Group list returned by page
Exceptions
HyphenateExceptionError info, see EMError
EMCursorResult<EMGroupInfo> com.hyphenate.chat.EMGroupManager.getPublicGroupsFromServer ( int  pageSize,
String  cursor 
) throws HyphenateException

Get public groups from server by page Asynchronously method see asyncGetPublicGroupsFromServer(int, String, EMValueCallBack)

Synchronization method will block the current thread

Parameters
pageSizeThe count fetched a time
cursorThe cursor position to fetch data, use null if first call
Returns
Fetch result, see EMCursorResult, used to get next page and the group list, for the last page, EMCursorResult.getCursor() is an empty string.
Exceptions
HyphenateExceptionError code, see com.hyphenate.EMError
void com.hyphenate.chat.EMGroupManager.inviteUser ( String  groupId,
String[]  beInvitedUsernames,
String  reason 
) throws HyphenateException

Invite other users to join the group Note: The group style is EMGroupStyle#EMGroupStylePrivateMemberCanInvite, which allow group members to invite users Asynchronously method see asyncInviteUser(String, String[], String, EMCallBack)

Synchronization method will block the current thread

Parameters
groupIdGroup id
beInvitedUsernamesArray of users to be invited
reasonMessage for invitation
Exceptions
HyphenateExceptionError info, see EMError
void com.hyphenate.chat.EMGroupManager.joinGroup ( String  groupId) throws HyphenateException

Join the group by the group id If group's style is EMGroupStyle#EMGroupStylePublicOpenJoin,join it not require owner agree; If is EMGroupStyle#EMGroupStylePublicJoinNeedApproval, need owner's agreement Asynchronously method see asyncJoinGroup(String, EMCallBack)

Synchronization method will block the current thread

Parameters
groupIdGroup id
Exceptions
HyphenateExceptionError info, see EMError
void com.hyphenate.chat.EMGroupManager.leaveGroup ( String  groupId) throws HyphenateException

Current joined user exit group

Synchronization method will block the current thread

Parameters
groupIdGroup id
Exceptions
HyphenateExceptionError info, see EMError
synchronized void com.hyphenate.chat.EMGroupManager.loadAllGroups ( )

load all local groups from database

void com.hyphenate.chat.EMGroupManager.muteAllMembers ( final String  groupId,
final EMValueCallBack< EMGroup callBack 
)

Mute all members Owner or administrator‘s authority is required

Asynchronously method

Parameters
groupIdGroup id
callBackResult callback, success call EMValueCallBack#onSuccess(Object), return the updated group instance; Failure call EMValueCallBack#onError(int, String)
EMGroup com.hyphenate.chat.EMGroupManager.muteGroupMembers ( String  groupId,
List< String >  muteMembers,
long  duration 
) throws HyphenateException

Mute specified members from posting message for specified duration Owner or administrator‘s authority is required Asynchronously method see aysncMuteGroupMembers(String, List, long, EMValueCallBack)

Synchronization method will block the current thread

Parameters
groupIdGroup id
muteMembersMute member list
durationMute duration, in milli-seconds
Returns
Return the updated group instance
Exceptions
HyphenateExceptionError info, see EMError
void com.hyphenate.chat.EMGroupManager.removeFromGroupWhiteList ( final String  groupId,
final List< String >  members,
final EMCallBack  callBack 
)

Remove members from whitelist Owner or administrator‘s authority is required

Asynchronously method

Parameters
groupIdGroup id
membersMember list to add to whitelist
callBackResult callback, success call EMCallBack#onSuccess(), failure call EMCallBack#onError(int, String)
EMGroup com.hyphenate.chat.EMGroupManager.removeGroupAdmin ( String  groupId,
String  admin 
) throws HyphenateException

Remove group administrator Owner‘s authority is required Asynchronously method see asyncRemoveGroupAdmin(String, String, EMValueCallBack)

Synchronization method will block the current thread

Parameters
groupIdGroup id
adminAdmin id to remove
Returns
Return the updated group instance
Exceptions
HyphenateExceptionError info, see EMError
void com.hyphenate.chat.EMGroupManager.removeGroupChangeListener ( EMGroupChangeListener  listener)

Remove group change listener Use this method after registering addGroupChangeListener(EMGroupChangeListener)

Parameters
listenerListener of group event to unregister
void com.hyphenate.chat.EMGroupManager.removeUserFromGroup ( final String  groupId,
final String  username 
) throws HyphenateException

Remove member from group Owner or administrator‘s authority is required Asynchronously method see asyncRemoveUserFromGroup(String, String, EMCallBack)

Synchronization method will block the current thread

Parameters
groupIdGroup id
usernameUser id to be removed
Exceptions
HyphenateExceptionError info, see EMError
void com.hyphenate.chat.EMGroupManager.removeUsersFromGroup ( final String  groupId,
final List< String >  members 
) throws HyphenateException

Remove members from group Owner or administrator‘s authority is required Asynchronously method see asyncRemoveUsersFromGroup(String, List, EMCallBack)}

Synchronization method will block the current thread

Parameters
groupIdGroup id
membersUser ids to be removed
Exceptions
HyphenateExceptionError info, see EMError
void com.hyphenate.chat.EMGroupManager.unblockGroupMessage ( String  groupId) throws HyphenateException

Set to enable to receive the group message again Asynchronously method see asyncUnblockGroupMessage(String, EMCallBack)

Synchronization method will block the current thread

Parameters
groupIdGroup id
Exceptions
HyphenateExceptionError info, see EMError
void com.hyphenate.chat.EMGroupManager.unblockUser ( String  groupId,
String  username 
) throws HyphenateException

Remove the blocked user from the group blacklist Owner or administrator‘s authority is required Asynchronously method see asyncUnblockUser(String, String, EMCallBack)

Synchronization method will block the current thread

Parameters
groupIdGroup id
usernameUsername to remove from blacklist
Exceptions
HyphenateExceptionError info, see EMError
void com.hyphenate.chat.EMGroupManager.unblockUsers ( String  groupId,
List< String >  members 
) throws HyphenateException

Remove the blocked users from the group blacklist Owner or administrator‘s authority is required Asynchronously method see asyncBlockUsers(String, List, EMCallBack)

Synchronization method will block the current thread

Parameters
groupIdGroup id
membersThe users to remove from blacklist
Exceptions
HyphenateExceptionError info, see EMError
void com.hyphenate.chat.EMGroupManager.unmuteAllMembers ( final String  groupId,
final EMValueCallBack< EMGroup callBack 
)

Release all members muted Owner or administrator‘s authority is required

Asynchronously method

Parameters
groupIdGroup id
callBackResult callback, success call EMValueCallBack#onSuccess(Object), return the updated group instance; Failure call EMValueCallBack#onError(int, String)
EMGroup com.hyphenate.chat.EMGroupManager.unMuteGroupMembers ( String  groupId,
List< String >  members 
) throws HyphenateException

Unban the specified users Owner or administrator‘s authority is required Asynchronously method see asyncUnMuteGroupMembers(String, List, EMValueCallBack)

Synchronization method will block the current thread

Parameters
groupIdGroup id
membersThe users to release mute
Returns
Return the updated group instance
Exceptions
HyphenateExceptionError info, see EMError
void com.hyphenate.chat.EMGroupManager.updateGroupAnnouncement ( String  groupId,
String  announcement 
) throws HyphenateException

Update group announcement Owner or administrator‘s authority is required Asynchronously method see asyncUpdateGroupAnnouncement(String, String, EMCallBack)

Synchronization method will block the current thread

Parameters
groupIdGroup id
announcementGroup announcement
Exceptions
HyphenateExceptionError info, see EMError
EMGroup com.hyphenate.chat.EMGroupManager.updateGroupExtension ( String  groupId,
String  extension 
) throws HyphenateException

update group extension Owner or administrator‘s authority is required

Synchronization method will block the current thread

Parameters
groupIdGroup id
extensionExtension string
Exceptions
HyphenateExceptionError info, see EMError
EMMucSharedFile com.hyphenate.chat.EMGroupManager.uploadGroupSharedFile ( String  groupId,
String  filePath,
EMCallBack  callBack 
) throws HyphenateException

Upload file to group Note: The callback only callback the progress Asynchronously method see asyncUploadGroupSharedFile(String, String, EMCallBack)

Synchronization method will block the current thread

Parameters
groupIdgroup id
filePathFile local path
callBackProgress callback of uploading file
Returns
The shared file instance
Exceptions
HyphenateExceptionError info, see EMError

The documentation for this class was generated from the following file: