hyphenate_SDK3.0
3.6.1
hyphenatejavaIMSDK
|
类 | |
enum | EMGroupStyle |
Public 成员函数 | |
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 | 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 | 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 |
void | asyncGetJoinedGroupsFromServer (final EMValueCallBack< List< EMGroup >> callback) |
void | asyncGetJoinedGroupsFromServer (final int pageIndex, final int pageSize, final EMValueCallBack< List< EMGroup >> 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 | unblockUser (String groupId, String username) throws HyphenateException |
void | asyncUnblockUser (final String groupId, final String username, 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 | 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< 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) |
EMGroup | updateGroupExtension (String groupId, String extension) throws HyphenateException |
群组管理, 用于管理群组的创建,删除,成员管理等操作
void com.hyphenate.chat.EMGroupManager.acceptApplication | ( | String | username, |
String | groupId | ||
) | throws HyphenateException |
同意加群申请
username | 申请人username |
groupId | 要申请加入的群id |
HyphenateException |
EMGroup com.hyphenate.chat.EMGroupManager.acceptInvitation | ( | String | groupId, |
String | inviter | ||
) | throws HyphenateException |
接受加入群的邀请
groupId | |
inviter |
EMGroup com.hyphenate.chat.EMGroupManager.addGroupAdmin | ( | final String | groupId, |
final String | admin | ||
) | throws HyphenateException |
增加群组管理员,需要owner权限,admin無权限
同步方法,会阻塞当前线程
groupId | |
admin |
HyphenateException |
void com.hyphenate.chat.EMGroupManager.addGroupChangeListener | ( | EMGroupChangeListener | listener | ) |
void com.hyphenate.chat.EMGroupManager.addUsersToGroup | ( | String | groupId, |
String [] | newmembers | ||
) | throws HyphenateException |
向群组中添加新的成员
groupId | 群组的ID |
newmembers | 待添加的新成员用户名 |
HyphenateException |
void com.hyphenate.chat.EMGroupManager.applyJoinToGroup | ( | String | groupId, |
String | reason | ||
) | throws HyphenateException |
申请加入某个群(用于加入需要验证的公开群)
groupId | |
reason | 申请加入的原因 |
void com.hyphenate.chat.EMGroupManager.asyncAcceptApplication | ( | final String | username, |
final String | groupId, | ||
final EMCallBack | callback | ||
) |
同意加群申请
username | 申请人username |
groupId | 要申请加入的群id |
callback |
void com.hyphenate.chat.EMGroupManager.asyncAcceptInvitation | ( | final String | groupId, |
final String | inviter, | ||
final EMValueCallBack< EMGroup > | callback | ||
) |
接受加入群的邀请
groupId | |
inviter | |
callback |
void com.hyphenate.chat.EMGroupManager.asyncAddGroupAdmin | ( | final String | groupId, |
final String | admin, | ||
final EMValueCallBack< EMGroup > | callback | ||
) |
增加群组管理员,需要owner权限
groupId | |
admin | |
callback |
void com.hyphenate.chat.EMGroupManager.asyncAddUsersToGroup | ( | final String | groupId, |
final String [] | newmembers, | ||
final EMCallBack | callback | ||
) |
向群组中添加新的成员
groupId | 群组的ID |
newmembers | 待添加的新成员用户名 |
callback |
void com.hyphenate.chat.EMGroupManager.asyncApplyJoinToGroup | ( | final String | groupId, |
final String | reason, | ||
final EMCallBack | callback | ||
) |
申请加入某个群(用于加入需要验证的公开群)
groupId | |
reason | 申请加入的原因 |
callback |
void com.hyphenate.chat.EMGroupManager.asyncBlockGroupMessage | ( | final String | groupId, |
final EMCallBack | callback | ||
) |
屏蔽群消息,(还是群里面的成员,但不再接收群消息
groupId | |
callback |
void com.hyphenate.chat.EMGroupManager.asyncBlockUser | ( | final String | groupId, |
final String | username, | ||
final EMCallBack | callback | ||
) |
将用户加到群组的黑名单,被加入黑名单的用户无法加入群,无法收发此群的消息 (只有群主才能设置群的黑名单)
groupId | 群组的id |
username | 待屏蔽的用户名 |
callback |
void com.hyphenate.chat.EMGroupManager.asyncChangeGroupDescription | ( | final String | groupId, |
final String | changedDescription, | ||
final EMCallBack | callBack | ||
) |
修改群描述(群主才能调用此方法)
groupId | 群id |
changedDescription | 改变后的群描述 |
callBack |
void com.hyphenate.chat.EMGroupManager.asyncChangeGroupName | ( | final String | groupId, |
final String | changedGroupName, | ||
final EMCallBack | callback | ||
) |
改变群组的名称(群主才能调用此方法)
groupId | 需要改变名称的群组的id |
changedGroupName | 改变后的群组名称 |
callback |
void com.hyphenate.chat.EMGroupManager.asyncChangeOwner | ( | final String | groupId, |
final String | newOwner, | ||
final EMValueCallBack< EMGroup > | callback | ||
) |
群组所有权给他人
groupId | |
newOwner | |
callback |
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 | ||
) |
在IM服务器创建一个群组
groupName | 群组的名字 |
desc | 群组敘述 |
allMembers | 群成员数组,不需要群主id |
reason | 邀请群成员加入时的邀请信息 |
option | 群的设置 |
callback |
void com.hyphenate.chat.EMGroupManager.asyncDeclineApplication | ( | final String | username, |
final String | groupId, | ||
final String | reason, | ||
final EMCallBack | callback | ||
) |
拒绝加群申请
username | 申请人username |
groupId | 要申请加入的群id |
reason | 拒绝的理由 |
callback |
void com.hyphenate.chat.EMGroupManager.asyncDeclineInvitation | ( | final String | groupId, |
final String | inviter, | ||
final String | reason, | ||
final EMCallBack | callback | ||
) |
拒绝加入群的邀请
groupId | |
inviter | |
reason | 拒绝的原因 |
callback |
void com.hyphenate.chat.EMGroupManager.asyncDeleteGroupSharedFile | ( | final String | groupId, |
final String | fileId, | ||
final EMCallBack | callBack | ||
) |
异步从群组里删除这个共享文件
groupId | 群id |
fileId | 文件id |
callBack | 回调 |
void com.hyphenate.chat.EMGroupManager.asyncDestroyGroup | ( | final String | groupId, |
final EMCallBack | callback | ||
) |
解散群组 (只有群组的创建者才能调用此函数来删除)
groupId | |
callback |
void com.hyphenate.chat.EMGroupManager.asyncDownloadGroupSharedFile | ( | final String | groupId, |
final String | fileId, | ||
final String | savePath, | ||
final EMCallBack | callBack | ||
) |
异步下载群里的某个共享文件
groupId | 群id |
fileId | 文件id |
savePath | 文件保存路径 |
callBack | 回调 |
void com.hyphenate.chat.EMGroupManager.asyncFetchGroupAnnouncement | ( | final String | groupId, |
final EMValueCallBack< String > | callBack | ||
) |
异步从服务器获取群公告
groupId | 群组id |
callBack | 回调 |
void com.hyphenate.chat.EMGroupManager.asyncFetchGroupBlackList | ( | final String | groupId, |
final int | pageNum, | ||
final int | pageSize, | ||
final EMValueCallBack< List< String >> | callBack | ||
) |
从服务器获分页获取群组黑名单,方法适用于成员数量较大的群组,需要群组拥有者或者管理员权限
groupId | 群组id |
pageNum | 分页号 |
pageSize | 分页大小 |
callBack | 异步函数回调方法 |
void com.hyphenate.chat.EMGroupManager.asyncFetchGroupMembers | ( | final String | groupId, |
final String | cursor, | ||
final int | pageSize, | ||
final EMValueCallBack< EMCursorResult< String >> | callback | ||
) |
获取群组成员列表, 异步方法
EMCursorResult result = fetchGroupMembers(groupId, cursor, pageSize); // search 1 result = fetchGroupMembers(groupId, result.getCursor(), pageSize); // search 2
groupId | |
cursor | cursor是记录上次查询返回结果所在位置,继续查询时传入cursor, 返回结果继续上次查询 |
pageSize | |
callback |
void com.hyphenate.chat.EMGroupManager.asyncFetchGroupMuteList | ( | final String | groupId, |
final int | pageNum, | ||
final int | pageSize, | ||
final EMValueCallBack< Map< String, Long >> | callBack | ||
) |
获取群组的禁言列表,需要群组拥有者或者管理员权限
groupId | |
pageNum | |
pageSize | |
callBack | callback function that receive the executed result. Map.entry.key is username of mute action, Map.entry.value is expired time of banning post action. |
void com.hyphenate.chat.EMGroupManager.asyncFetchGroupSharedFileList | ( | final String | groupId, |
final int | pageNum, | ||
final int | pageSize, | ||
final EMValueCallBack< List< EMMucSharedFile >> | callBack | ||
) |
异步从服务器获取群组的共享文件列表
groupId | 群id |
pageNum | 分页号 |
pageSize | 分页大小 |
callBack | 回调 |
void com.hyphenate.chat.EMGroupManager.asyncGetBlockedUsers | ( | final String | groupId, |
final EMValueCallBack< List< String >> | callback | ||
) |
获取群组的黑名单用户列表, 默认最多取200个成员(只有群主才能调用此函数)
callback |
void com.hyphenate.chat.EMGroupManager.asyncGetBlockedUsers | ( | final String | groupId, |
final int | pageIndex, | ||
final int | pageSize, | ||
final EMValueCallBack< List< String >> | callback | ||
) |
获取群组的黑名单用户列表 (只有群主才能调用此函数)
callback |
void com.hyphenate.chat.EMGroupManager.asyncGetGroupFromServer | ( | final String | groupId, |
final EMValueCallBack< EMGroup > | callback | ||
) |
从服务器获取群组的详细信息和最新的成员列表
groupId | |
callback | 包含更新的群组对象 |
void com.hyphenate.chat.EMGroupManager.asyncGetJoinedGroupsFromServer | ( | final EMValueCallBack< List< EMGroup >> | callback | ) |
从服务器端获取当前用户的所有群组 (此操作只返回群组列表,并不获取群组的所有成员信息,如果要更新某个群组包括成员的全部信息,需要再调用 getGroupFromServer(String groupId)
callback | 包含群组列表 |
void com.hyphenate.chat.EMGroupManager.asyncGetJoinedGroupsFromServer | ( | final int | pageIndex, |
final int | pageSize, | ||
final EMValueCallBack< List< EMGroup >> | callback | ||
) |
从服务器端获取当前用户的所有群组 (此操作只返回群组列表,并不获取群组的所有成员信息,如果要更新某个群组包括成员的全部信息,需要再调用 getGroupFromServer(String groupId)
pageIndex | |
pageSize | |
callback | 群组列表 |
void com.hyphenate.chat.EMGroupManager.asyncGetPublicGroupsFromServer | ( | final int | pageSize, |
final String | cursor, | ||
final EMValueCallBack< EMCursorResult< EMGroupInfo >> | callback | ||
) |
从服务器获取公开群组
pageSize | 获取多少条 |
cursor | 用于分批获取数据的cursor,首次获取数据时传null即可 |
callback | 包含用于下次获取数据的cursor以及群组list的对象 |
void com.hyphenate.chat.EMGroupManager.asyncInviteUser | ( | final String | groupId, |
final String [] | beInvitedUsernames, | ||
final String | reason, | ||
final EMCallBack | callback | ||
) |
群成员邀请用户加入群组(如果群组设置成可以成员邀请,现在的群组成员可以邀请其他用户加入)
groupId | 群组Id |
beInvitedUsernames | 被邀请人username的数组 |
reason | |
callback |
void com.hyphenate.chat.EMGroupManager.asyncJoinGroup | ( | final String | groupId, |
final EMCallBack | callback | ||
) |
当前登录用户加入公开群(如果是自由加入的公开群,直接进入群组;需要验证的公开群需要等待群主同意)
groupId |
void com.hyphenate.chat.EMGroupManager.asyncLeaveGroup | ( | final String | groupId, |
final EMCallBack | callback | ||
) |
当前登录用户退出群组
groupId | |
callback |
void com.hyphenate.chat.EMGroupManager.asyncRemoveGroupAdmin | ( | final String | groupId, |
final String | admin, | ||
final EMValueCallBack< EMGroup > | callback | ||
) |
删除群组管理员,需要owner权限
groupId | |
admin | |
callback |
void com.hyphenate.chat.EMGroupManager.asyncRemoveUserFromGroup | ( | final String | groupId, |
final String | username, | ||
final EMCallBack | callback | ||
) |
从群组中删除成员
groupId | 群组的ID |
username | 待删除成员的用户名 |
callback |
void com.hyphenate.chat.EMGroupManager.asyncUnblockGroupMessage | ( | final String | groupId, |
final EMCallBack | callback | ||
) |
取消屏蔽群消息
groupId | |
callback |
void com.hyphenate.chat.EMGroupManager.asyncUnblockUser | ( | final String | groupId, |
final String | username, | ||
final EMCallBack | callback | ||
) |
将用户从群组的黑名单移除
groupId | 群组的id |
username | 待解除屏蔽的 用户名 |
callback |
void com.hyphenate.chat.EMGroupManager.asyncUnMuteGroupMembers | ( | final String | groupId, |
final List< String > | members, | ||
final EMValueCallBack< EMGroup > | callback | ||
) |
取消禁言,需要群组拥有者或者管理员权限
groupId | |
members | |
callback |
void com.hyphenate.chat.EMGroupManager.asyncUpdateGroupAnnouncement | ( | final String | groupId, |
final String | announcement, | ||
final EMCallBack | callBack | ||
) |
异步更新群公告
groupId | 群id |
announcement | 公告内容 |
callBack | 回调 |
void com.hyphenate.chat.EMGroupManager.asyncUploadGroupSharedFile | ( | final String | groupId, |
final String | filePath, | ||
final EMCallBack | callBack | ||
) |
异步上传共享文件至群组
groupId | 群id |
filePath | 文件本地路径 |
callBack | 回调 |
void com.hyphenate.chat.EMGroupManager.aysncMuteGroupMembers | ( | final String | groupId, |
final List< String > | muteMembers, | ||
final long | duration, | ||
final EMValueCallBack< EMGroup > | callback | ||
) |
禁止某些群组成员发言, 需要群组拥有者或者管理员权限
groupId | |
muteMembers | 需要禁言的群组成员 |
duration | 禁言持续时间,单位是毫秒 |
callback |
void com.hyphenate.chat.EMGroupManager.blockGroupMessage | ( | String | groupId | ) | throws HyphenateException |
屏蔽群消息,(还是群里面的成员,但不再接收群消息
groupId |
HyphenateException |
void com.hyphenate.chat.EMGroupManager.blockUser | ( | String | groupId, |
String | username | ||
) | throws HyphenateException |
将用户加到群组的黑名单,被加入黑名单的用户无法加入群,无法收发此群的消息 (只有群主才能设置群的黑名单)。 3.3.0群组改造和之前版本的区别:被加入到黑名单的用户会被先移出群,再加入到黑名单中,之前版本没有移出群的动作。
groupId | 群组的id |
username | 待屏蔽的用户名 |
HyphenateException |
void com.hyphenate.chat.EMGroupManager.changeGroupDescription | ( | String | groupId, |
String | changedDescription | ||
) | throws HyphenateException |
修改群描述(群主才能调用此方法)
同步方法,会阻塞当前线程
groupId | 群id |
changedDescription | 改变后的群描述 |
HyphenateException |
void com.hyphenate.chat.EMGroupManager.changeGroupName | ( | String | groupId, |
String | changedGroupName | ||
) | throws HyphenateException |
改变群组的名称(群主才能调用此方法)
同步方法,会阻塞当前线程
groupId | 需要改变名称的群组的id |
changedGroupName | 改变后的群组名称 |
HyphenateException |
EMGroup com.hyphenate.chat.EMGroupManager.changeOwner | ( | String | groupId, |
String | newOwner | ||
) | throws HyphenateException |
群组所有权给他人
同步方法,会阻塞当前线程
groupId | |
newOwner |
HyphenateException |
EMGroup com.hyphenate.chat.EMGroupManager.createGroup | ( | String | groupName, |
String | desc, | ||
String [] | allMembers, | ||
String | reason, | ||
EMGroupOptions | option | ||
) | throws HyphenateException |
在IM服务器创建一个群组
同步方法,会阻塞当前线程
groupName | 群组的名字 |
desc | 群组敘述 |
allMembers | 群成员数组,不需要群主id |
reason | 邀请群成员加入时的邀请信息 |
option | 群的设置 |
void com.hyphenate.chat.EMGroupManager.declineApplication | ( | String | username, |
String | groupId, | ||
String | reason | ||
) | throws HyphenateException |
拒绝加群申请
username | 申请人username |
groupId | 要申请加入的群id |
reason | 拒绝的理由 |
HyphenateException |
void com.hyphenate.chat.EMGroupManager.declineInvitation | ( | String | groupId, |
String | inviter, | ||
String | reason | ||
) | throws HyphenateException |
拒绝加入群的邀请
同步方法,会阻塞当前线程
groupId | |
inviter | |
reason,拒绝的原因 |
void com.hyphenate.chat.EMGroupManager.deleteGroupSharedFile | ( | String | groupId, |
String | fileId | ||
) | throws HyphenateException |
从群组里删除这个共享文件
同步方法,会阻塞当前线程
groupId | 群id |
fileId | 文件id |
HyphenateException |
void com.hyphenate.chat.EMGroupManager.destroyGroup | ( | final String | groupId | ) | throws HyphenateException |
解散群组 (只有群组的创建者才能调用此函数来删除)
groupId |
HyphenateException |
void com.hyphenate.chat.EMGroupManager.downloadGroupSharedFile | ( | String | groupId, |
String | fileId, | ||
String | savePath, | ||
EMCallBack | callBack | ||
) | throws HyphenateException |
下载群里的某个共享文件,注意callback只做进度回调用
同步方法,会阻塞当前线程
groupId | 群id |
fileId | 文件id |
savePath | 文件保存路径 |
callBack | 回调 |
HyphenateException |
String com.hyphenate.chat.EMGroupManager.fetchGroupAnnouncement | ( | String | groupId | ) | throws HyphenateException |
从服务器获取群公告
同步方法,会阻塞当前线程
groupId | 群组id |
HyphenateException |
List<String> com.hyphenate.chat.EMGroupManager.fetchGroupBlackList | ( | String | groupId, |
int | pageNum, | ||
int | pageSize | ||
) | throws HyphenateException |
从服务器获分页获取群组黑名单,方法适用于成员数量较大的群组,需要群组拥有者或者管理员权限
同步方法,会阻塞当前线程
groupId | 群组id |
pageNum | 分页号 |
pageSize | 分页大小 |
HyphenateException |
EMCursorResult<String> com.hyphenate.chat.EMGroupManager.fetchGroupMembers | ( | String | groupId, |
String | cursor, | ||
int | pageSize | ||
) | throws HyphenateException |
获取群组成员列表,最后一页返回结果EMCursorResult.getCursor()返回为空字符串
同步方法,会阻塞当前线程
groupId | |
cursor | |
pageSize |
HyphenateException |
Map<String, Long> com.hyphenate.chat.EMGroupManager.fetchGroupMuteList | ( | String | groupId, |
int | pageNum, | ||
int | pageSize | ||
) | throws HyphenateException |
获取群组的禁言列表,需要群组拥有者或者管理员权限
同步方法,会阻塞当前线程
groupId | |
pageNum | |
pageSize |
HyphenateException |
List<EMMucSharedFile> com.hyphenate.chat.EMGroupManager.fetchGroupSharedFileList | ( | String | groupId, |
int | pageNum, | ||
int | pageSize | ||
) | throws HyphenateException |
从服务器获取群组的共享文件列表
同步方法,会阻塞当前线程
groupId | 群id |
pageNum | 分页号 |
pageSize | 分页大小 |
HyphenateException |
List<EMGroup> com.hyphenate.chat.EMGroupManager.getAllGroups | ( | ) |
获取当前(内存)用户的所有群组
List<String> com.hyphenate.chat.EMGroupManager.getBlockedUsers | ( | String | groupId | ) | throws HyphenateException |
获取群组的黑名单用户列表, 默认最多取200个成员 (只有群主才能调用此函数) return List
HyphenateException | 获取失败 |
List<String> com.hyphenate.chat.EMGroupManager.getBlockedUsers | ( | String | groupId, |
int | pageIndex, | ||
int | pageSize | ||
) | throws HyphenateException |
获取群组的黑名单用户列表(只有群主才能调用此函数)
return List
HyphenateException | 获取失败 |
EMGroup com.hyphenate.chat.EMGroupManager.getGroup | ( | String | groupId | ) |
根据群组ID,获得群组对象
groupId | 群组的ID |
EMGroup com.hyphenate.chat.EMGroupManager.getGroupFromServer | ( | String | groupId | ) | throws HyphenateException |
EMGroup com.hyphenate.chat.EMGroupManager.getGroupFromServer | ( | String | groupId, |
boolean | fetchMembers | ||
) | throws HyphenateException |
从服务器获取群组的详细信息。 fetchMembers为true的时候,获取群成员,如需获取更多成员,使用 fetchGroupMembers(String, String, int)。 只有群成员才能获取群组的成员列表。
fetchMembers | 是否获取成员列表,默认取200人的成员列表 |
synchronized List<EMGroup> com.hyphenate.chat.EMGroupManager.getJoinedGroupsFromServer | ( | ) | throws HyphenateException |
从服务器端获取当前用户的所有群组 (此操作只返回群组列表,并不获取群组的所有成员信息,如果要更新某个群组包括成员的全部信息,需要再调用 getGroupFromServer(String groupId)
HyphenateException |
synchronized List<EMGroup> com.hyphenate.chat.EMGroupManager.getJoinedGroupsFromServer | ( | int | pageIndex, |
int | pageSize | ||
) | throws HyphenateException |
从服务器端获取当前用户的所有群组 (此操作只返回群组列表,并不获取群组的所有成员信息,如果要更新某个群组包括成员的全部信息,需要再调用。 从第一页开始取。 getGroupFromServer(String groupId)
pageIndex | start from 1 |
pageSize |
HyphenateException |
EMCursorResult<EMGroupInfo> com.hyphenate.chat.EMGroupManager.getPublicGroupsFromServer | ( | int | pageSize, |
String | cursor | ||
) | throws HyphenateException |
从服务器获取公开群组
pageSize | 获取多少条 |
cursor | 用于分批获取数据的cursor,首次获取数据时传null即可 |
HyphenateException |
void com.hyphenate.chat.EMGroupManager.inviteUser | ( | String | groupId, |
String [] | beInvitedUsernames, | ||
String | reason | ||
) | throws HyphenateException |
群成员邀请用户加入群组 (如果群组设置成可以成员邀请,现在的群组成员可以邀请其他用户加入)
groupId | 群组Id |
beInvitedUsernames | 被邀请人username的数组 |
reason |
HyphenateException |
void com.hyphenate.chat.EMGroupManager.joinGroup | ( | String | groupId | ) | throws HyphenateException |
当前登录用户加入公开群(如果是自由加入的公开群,直接进入群组;需要验证的公开群需要等待群主同意)
groupId |
void com.hyphenate.chat.EMGroupManager.leaveGroup | ( | String | groupId | ) | throws HyphenateException |
当前登录用户退出群组
groupId |
HyphenateException |
synchronized void com.hyphenate.chat.EMGroupManager.loadAllGroups | ( | ) |
同步加载所有群组
EMGroup com.hyphenate.chat.EMGroupManager.muteGroupMembers | ( | String | groupId, |
List< String > | muteMembers, | ||
long | duration | ||
) | throws HyphenateException |
禁止某些群组成员发言, 需要群组拥有者或者管理员权限
同步方法,会阻塞当前线程
groupId | |
muteMembers | 禁言的用户列表 |
duration | 禁言的时间,单位是毫秒 |
HyphenateException |
EMGroup com.hyphenate.chat.EMGroupManager.removeGroupAdmin | ( | String | groupId, |
String | admin | ||
) | throws HyphenateException |
删除群组管理员,需要owner权限
同步方法,会阻塞当前线程
groupId | |
admin |
HyphenateException |
void com.hyphenate.chat.EMGroupManager.removeGroupChangeListener | ( | EMGroupChangeListener | listener | ) |
移除群组变化监听器
listener |
void com.hyphenate.chat.EMGroupManager.removeUserFromGroup | ( | final String | groupId, |
final String | username | ||
) | throws HyphenateException |
从群组中删除成员
groupId | 群组的ID |
username | 待删除成员的用户名 |
HyphenateException |
void com.hyphenate.chat.EMGroupManager.unblockGroupMessage | ( | String | groupId | ) | throws HyphenateException |
取消屏蔽群消息
groupId |
HyphenateException |
void com.hyphenate.chat.EMGroupManager.unblockUser | ( | String | groupId, |
String | username | ||
) | throws HyphenateException |
将用户从群组的黑名单移除
groupId | 群组的id |
username | 待解除屏蔽的 用户名 |
EMGroup com.hyphenate.chat.EMGroupManager.unMuteGroupMembers | ( | String | groupId, |
List< String > | members | ||
) | throws HyphenateException |
解除禁言, 需要群组拥有者或者管理员权限
同步方法,会阻塞当前线程
groupId | |
members |
HyphenateException |
void com.hyphenate.chat.EMGroupManager.updateGroupAnnouncement | ( | String | groupId, |
String | announcement | ||
) | throws HyphenateException |
更新群公告
同步方法,会阻塞当前线程
groupId | 群id |
announcement | 公告内容 |
HyphenateException |
EMGroup com.hyphenate.chat.EMGroupManager.updateGroupExtension | ( | String | groupId, |
String | extension | ||
) | throws HyphenateException |
更新群组扩展字段
groupId | 群组id |
extension | 群组扩展字段 |
EMMucSharedFile com.hyphenate.chat.EMGroupManager.uploadGroupSharedFile | ( | String | groupId, |
String | filePath, | ||
EMCallBack | callBack | ||
) | throws HyphenateException |
上传共享文件至群组,注意callback只做进度回调用
同步方法,会阻塞当前线程
groupId | 群id |
filePath | 文件本地路径 |
callBack | 回调 |
HyphenateException |