hyphenate_SDK3.0
3.6.0
hyphenatejavaIMSDK
|
Public 成员函数 | |
EMChatRoomManager (EMClient client, EMAChatRoomManager manager) | |
void | addChatRoomChangeListener (EMChatRoomChangeListener listener) |
void | removeChatRoomChangeListener (EMChatRoomChangeListener listener) |
void | removeChatRoomListener (EMChatRoomChangeListener listener) |
void | joinChatRoom (final String roomId, final EMValueCallBack< EMChatRoom > callback) |
void | leaveChatRoom (final String roomId) |
EMPageResult< EMChatRoom > | fetchPublicChatRoomsFromServer (int pageNum, int pageSize) throws HyphenateException |
EMCursorResult< EMChatRoom > | fetchPublicChatRoomsFromServer (int pageSize, String cursor) throws HyphenateException |
void | asyncFetchPublicChatRoomsFromServer (final int pageSize, final String cursor, final EMValueCallBack< EMCursorResult< EMChatRoom >> callback) |
void | asyncFetchPublicChatRoomsFromServer (final int pageNum, final int pageSize, final EMValueCallBack< EMPageResult< EMChatRoom >> callback) |
EMChatRoom | fetchChatRoomFromServer (String roomId) throws HyphenateException |
EMChatRoom | fetchChatRoomFromServer (String roomId, boolean fetchMembers) throws HyphenateException |
void | asyncFetchChatRoomFromServer (final String roomId, final EMValueCallBack< EMChatRoom > callback) |
EMChatRoom | getChatRoom (String roomId) |
List< EMChatRoom > | getAllChatRooms () |
EMChatRoom | createChatRoom (String subject, String description, String welcomeMessage, int maxUserCount, List< String > members) throws HyphenateException |
void | asyncCreateChatRoom (final String subject, final String description, final String welcomeMessage, final int maxUserCount, final List< String > members, final EMValueCallBack< EMChatRoom > callBack) |
void | destroyChatRoom (String chatRoomId) throws HyphenateException |
void | asyncDestroyChatRoom (final String chatRoomId, final EMCallBack callBack) |
EMChatRoom | changeChatRoomSubject (String chatRoomId, String newSubject) throws HyphenateException |
void | asyncChangeChatRoomSubject (final String chatRoomId, final String newSubject, final EMValueCallBack< EMChatRoom > callBack) |
EMChatRoom | changeChatroomDescription (String chatRoomId, String newDescription) throws HyphenateException |
void | asyncChangeChatroomDescription (final String chatRoomId, final String newDescription, final EMValueCallBack< EMChatRoom > callBack) |
EMCursorResult< String > | fetchChatRoomMembers (String chatRoomId, String cursor, int pageSize) throws HyphenateException |
void | asyncFetchChatRoomMembers (final String chatRoomId, final String cursor, final int pageSize, final EMValueCallBack< EMCursorResult< String >> callBack) |
EMChatRoom | muteChatRoomMembers (String chatRoomId, List< String > muteMembers, long duration) throws HyphenateException |
void | asyncMuteChatRoomMembers (final String chatRoomId, final List< String > muteMembers, final long duration, final EMValueCallBack< EMChatRoom > callBack) |
EMChatRoom | unMuteChatRoomMembers (String chatRoomId, List< String > members) throws HyphenateException |
void | asyncUnMuteChatRoomMembers (final String chatRoomId, final List< String > members, final EMValueCallBack< EMChatRoom > callBack) |
EMChatRoom | changeOwner (String chatRoomId, String newOwner) throws HyphenateException |
void | asyncChangeOwner (final String chatRoomId, final String newOwner, final EMValueCallBack< EMChatRoom > callBack) throws HyphenateException |
EMChatRoom | addChatRoomAdmin (String chatRoomId, String admin) throws HyphenateException |
void | asyncAddChatRoomAdmin (final String chatRoomId, final String admin, final EMValueCallBack< EMChatRoom > callBack) |
EMChatRoom | removeChatRoomAdmin (String chatRoomId, String admin) throws HyphenateException |
void | asyncRemoveChatRoomAdmin (final String chatRoomId, final String admin, final EMValueCallBack< EMChatRoom > callBack) |
Map< String, Long > | fetchChatRoomMuteList (String chatRoomId, int pageNum, int pageSize) throws HyphenateException |
void | asyncFetchChatRoomMuteList (final String chatRoomId, final int pageNum, final int pageSize, final EMValueCallBack< Map< String, Long >> callBack) |
EMChatRoom | removeChatRoomMembers (String chatRoomId, List< String > members) throws HyphenateException |
void | asyncRemoveChatRoomMembers (final String chatRoomId, final List< String > members, final EMValueCallBack< EMChatRoom > callBack) |
EMChatRoom | blockChatroomMembers (String chatRoomId, List< String > members) throws HyphenateException |
void | asyncBlockChatroomMembers (final String chatRoomId, final List< String > members, final EMValueCallBack< EMChatRoom > callBack) |
EMChatRoom | unblockChatRoomMembers (String chatRoomId, List< String > members) throws HyphenateException |
void | asyncUnBlockChatRoomMembers (final String chatRoomId, final List< String > members, final EMValueCallBack< EMChatRoom > callBack) |
List< String > | fetchChatRoomBlackList (String chatRoomId, int pageNum, int pageSize) throws HyphenateException |
void | asyncFetchChatRoomBlackList (final String chatRoomId, final int pageNum, final int pageSize, final EMValueCallBack< List< String >> callBack) |
void | updateChatRoomAnnouncement (String chatRoomId, String announcement) throws HyphenateException |
void | asyncUpdateChatRoomAnnouncement (final String chatRoomId, final String announcement, final EMCallBack callBack) |
String | fetchChatRoomAnnouncement (String chatRoomId) throws HyphenateException |
void | asyncFetchChatRoomAnnouncement (final String chatRoomId, final EMValueCallBack< String > callBack) |
EMChatRoom com.hyphenate.chat.EMChatRoomManager.addChatRoomAdmin | ( | String | chatRoomId, |
String | admin | ||
) | throws HyphenateException |
为聊天室添加管理员,需要拥有者权限
chatRoomId | |
admin |
HyphenateException |
void com.hyphenate.chat.EMChatRoomManager.addChatRoomChangeListener | ( | EMChatRoomChangeListener | listener | ) |
注册聊天室事件监听
listener |
void com.hyphenate.chat.EMChatRoomManager.asyncAddChatRoomAdmin | ( | final String | chatRoomId, |
final String | admin, | ||
final EMValueCallBack< EMChatRoom > | callBack | ||
) |
为聊天室添加管理员,需要拥有者权限
chatRoomId | |
admin | |
callBack |
void com.hyphenate.chat.EMChatRoomManager.asyncBlockChatroomMembers | ( | final String | chatRoomId, |
final List< String > | members, | ||
final EMValueCallBack< EMChatRoom > | callBack | ||
) |
添加成员到黑名单,禁止成员继续加入聊天室,需要拥有者或者管理员权限
chatRoomId | |
members | |
callBack |
void com.hyphenate.chat.EMChatRoomManager.asyncChangeChatroomDescription | ( | final String | chatRoomId, |
final String | newDescription, | ||
final EMValueCallBack< EMChatRoom > | callBack | ||
) |
修改群描述信息,需要owner权,同步方法
chatRoomId | |
newDescription |
void com.hyphenate.chat.EMChatRoomManager.asyncChangeChatRoomSubject | ( | final String | chatRoomId, |
final String | newSubject, | ||
final EMValueCallBack< EMChatRoom > | callBack | ||
) |
修改聊天室标题,需要owner权,同步方法
chatRoomId | |
newSubject |
void com.hyphenate.chat.EMChatRoomManager.asyncChangeOwner | ( | final String | chatRoomId, |
final String | newOwner, | ||
final EMValueCallBack< EMChatRoom > | callBack | ||
) | throws HyphenateException |
转移聊天室的所有权
chatRoomId | |
newOwner | |
callBack |
void com.hyphenate.chat.EMChatRoomManager.asyncCreateChatRoom | ( | final String | subject, |
final String | description, | ||
final String | welcomeMessage, | ||
final int | maxUserCount, | ||
final List< String > | members, | ||
final EMValueCallBack< EMChatRoom > | callBack | ||
) |
创建聊天室,聊天室最大人数上限10000。异步方法
subject | 名称 |
description | 描述 |
welcomeMessage | 邀请成员加入聊天室的消息 |
maxUserCount | 允许加入聊天室的最大成员数 |
members | 邀请加入聊天室的成员列表 |
callBack | 程序回调函数,onSuccess会包含该聊天室 |
void com.hyphenate.chat.EMChatRoomManager.asyncDestroyChatRoom | ( | final String | chatRoomId, |
final EMCallBack | callBack | ||
) |
销毁聊天室,需要owner权,同步方法
chatRoomId | |
callBack |
void com.hyphenate.chat.EMChatRoomManager.asyncFetchChatRoomAnnouncement | ( | final String | chatRoomId, |
final EMValueCallBack< String > | callBack | ||
) |
从服务器获取聊天室公告内容
chatRoomId | 聊天室id |
callBack | 回调 |
callBack |
void com.hyphenate.chat.EMChatRoomManager.asyncFetchChatRoomBlackList | ( | final String | chatRoomId, |
final int | pageNum, | ||
final int | pageSize, | ||
final EMValueCallBack< List< String >> | callBack | ||
) |
获取群组黑名单列表,分页显示,需要拥有者或者管理员权限
chatRoomId | |
pageNum | |
pageSize | |
callBack |
void com.hyphenate.chat.EMChatRoomManager.asyncFetchChatRoomFromServer | ( | final String | roomId, |
final EMValueCallBack< EMChatRoom > | callback | ||
) |
从服务器获取聊天室详情 耗时操作
roomId | |
callback |
void com.hyphenate.chat.EMChatRoomManager.asyncFetchChatRoomMembers | ( | final String | chatRoomId, |
final String | cursor, | ||
final int | pageSize, | ||
final EMValueCallBack< EMCursorResult< String >> | callBack | ||
) |
获取聊天室成员列表
chatRoomId | |
cursor | |
pageSize | |
callBack |
void com.hyphenate.chat.EMChatRoomManager.asyncFetchChatRoomMuteList | ( | final String | chatRoomId, |
final int | pageNum, | ||
final int | pageSize, | ||
final EMValueCallBack< Map< String, Long >> | callBack | ||
) |
获取聊天室的禁言列表,需要拥有者或者管理员权限
chatRoomId | |
pageNum | |
pageSize | |
callBack |
void com.hyphenate.chat.EMChatRoomManager.asyncFetchPublicChatRoomsFromServer | ( | final int | pageSize, |
final String | cursor, | ||
final EMValueCallBack< EMCursorResult< EMChatRoom >> | callback | ||
) |
翻页从服务器获取聊天室 耗时操作
pageSize | 一次取多少条 |
cursor | 从这个游标位置开始取 |
callback |
void com.hyphenate.chat.EMChatRoomManager.asyncFetchPublicChatRoomsFromServer | ( | final int | pageNum, |
final int | pageSize, | ||
final EMValueCallBack< EMPageResult< EMChatRoom >> | callback | ||
) |
翻页从服务器获取聊天室 耗时操作
pageNum | 当前要拉取的页数,从1开始 |
pageSize | 当前要拉取页的数量 |
callback |
void com.hyphenate.chat.EMChatRoomManager.asyncMuteChatRoomMembers | ( | final String | chatRoomId, |
final List< String > | muteMembers, | ||
final long | duration, | ||
final EMValueCallBack< EMChatRoom > | callBack | ||
) |
禁止聊天室成员发言,需要聊天室拥有者或者管理员权限
chatRoomId | |
muteMembers | 需要禁言的群组成员 |
duration | 禁言持续时间,单位是毫秒 |
callBack |
void com.hyphenate.chat.EMChatRoomManager.asyncRemoveChatRoomAdmin | ( | final String | chatRoomId, |
final String | admin, | ||
final EMValueCallBack< EMChatRoom > | callBack | ||
) |
删除聊天室管理员,需要拥有着权限
chatRoomId | |
admin | |
callBack |
void com.hyphenate.chat.EMChatRoomManager.asyncRemoveChatRoomMembers | ( | final String | chatRoomId, |
final List< String > | members, | ||
final EMValueCallBack< EMChatRoom > | callBack | ||
) |
删除聊天室成员,需要拥有者或者管理员权限
chatRoomId | |
members | |
callBack |
void com.hyphenate.chat.EMChatRoomManager.asyncUnBlockChatRoomMembers | ( | final String | chatRoomId, |
final List< String > | members, | ||
final EMValueCallBack< EMChatRoom > | callBack | ||
) |
将成员从黑名单种移除,需要拥有者或者管理员权限
chatRoomId | |
members | |
callBack |
void com.hyphenate.chat.EMChatRoomManager.asyncUnMuteChatRoomMembers | ( | final String | chatRoomId, |
final List< String > | members, | ||
final EMValueCallBack< EMChatRoom > | callBack | ||
) |
取消禁言,需要聊天室拥有者或者管理员权限,异步方法
chatRoomId | |
members | |
callBack |
void com.hyphenate.chat.EMChatRoomManager.asyncUpdateChatRoomAnnouncement | ( | final String | chatRoomId, |
final String | announcement, | ||
final EMCallBack | callBack | ||
) |
异步更新聊天室公告
chatRoomId | 聊天室id |
announcement | 公告内容 |
callBack | 回调 |
callBack |
EMChatRoom com.hyphenate.chat.EMChatRoomManager.blockChatroomMembers | ( | String | chatRoomId, |
List< String > | members | ||
) | throws HyphenateException |
添加成员到黑名单,禁止成员继续加入聊天室,需要拥有者或者管理员权限
chatRoomId | |
members |
HyphenateException |
EMChatRoom com.hyphenate.chat.EMChatRoomManager.changeChatroomDescription | ( | String | chatRoomId, |
String | newDescription | ||
) | throws HyphenateException |
修改群描述信息,需要owner权,同步方法
chatRoomId | |
newDescription |
HyphenateException |
EMChatRoom com.hyphenate.chat.EMChatRoomManager.changeChatRoomSubject | ( | String | chatRoomId, |
String | newSubject | ||
) | throws HyphenateException |
修改聊天室标题,需要owner权,同步方法
chatRoomId | |
newSubject |
HyphenateException |
EMChatRoom com.hyphenate.chat.EMChatRoomManager.changeOwner | ( | String | chatRoomId, |
String | newOwner | ||
) | throws HyphenateException |
转移聊天室的所有权,需要聊天室拥有者权限
chatRoomId | |
newOwner |
HyphenateException |
EMChatRoom com.hyphenate.chat.EMChatRoomManager.createChatRoom | ( | String | subject, |
String | description, | ||
String | welcomeMessage, | ||
int | maxUserCount, | ||
List< String > | members | ||
) | throws HyphenateException |
创建聊天室,聊天室最大人数上限10000
subject | 名称 |
description | 描述 |
welcomeMessage | 邀请成员加入聊天室的消息 |
maxUserCount | 允许加入聊天室的最大成员数 |
members | 邀请加入聊天室的成员列表 |
HyphenateException |
void com.hyphenate.chat.EMChatRoomManager.destroyChatRoom | ( | String | chatRoomId | ) | throws HyphenateException |
销毁聊天室,需要owner权,同步方法
chatRoomId |
HyphenateException |
String com.hyphenate.chat.EMChatRoomManager.fetchChatRoomAnnouncement | ( | String | chatRoomId | ) | throws HyphenateException |
从服务器获取聊天室公告内容
chatRoomId | 聊天室id |
HyphenateException |
List<String> com.hyphenate.chat.EMChatRoomManager.fetchChatRoomBlackList | ( | String | chatRoomId, |
int | pageNum, | ||
int | pageSize | ||
) | throws HyphenateException |
获取群组黑名单列表,分页显示,需要拥有者或者管理员权限
chatRoomId | |
pageNum | |
pageSize |
HyphenateException |
EMChatRoom com.hyphenate.chat.EMChatRoomManager.fetchChatRoomFromServer | ( | String | roomId | ) | throws HyphenateException |
EMChatRoom com.hyphenate.chat.EMChatRoomManager.fetchChatRoomFromServer | ( | String | roomId, |
boolean | fetchMembers | ||
) | throws HyphenateException |
从服务器获取聊天室详情,如果需要取成员列表,默认最多取200个成员,超出部分,请调用EMChatRoomManager#fetchChatRoomMembers(String, String, int) 耗时操作
roomId | 聊天室id |
fetchMembers | 是否需要获取聊天室成员 |
HyphenateException |
EMCursorResult<String> com.hyphenate.chat.EMChatRoomManager.fetchChatRoomMembers | ( | String | chatRoomId, |
String | cursor, | ||
int | pageSize | ||
) | throws HyphenateException |
获取聊天室成员列表, 获取最后一页成员列表时,EMCursorResult.getCursor()返回一个空字符串.
chatRoomId | |
cursor | |
pageSize |
HyphenateException |
Map<String, Long> com.hyphenate.chat.EMChatRoomManager.fetchChatRoomMuteList | ( | String | chatRoomId, |
int | pageNum, | ||
int | pageSize | ||
) | throws HyphenateException |
获取聊天室的禁言列表,需要拥有者或者管理员权限
chatRoomId | |
pageNum | |
pageSize |
HyphenateException |
EMPageResult<EMChatRoom> com.hyphenate.chat.EMChatRoomManager.fetchPublicChatRoomsFromServer | ( | int | pageNum, |
int | pageSize | ||
) | throws HyphenateException |
分页从服务器获取聊天室 耗时操作
pageNum | 当前要拉取的页数,从1开始 |
pageSize | 当前要拉取页的数量 |
HyphenateException |
EMCursorResult<EMChatRoom> com.hyphenate.chat.EMChatRoomManager.fetchPublicChatRoomsFromServer | ( | int | pageSize, |
String | cursor | ||
) | throws HyphenateException |
翻页从服务器获取聊天室,在获取最后一页时,EMCursorResult.getCursor()返回一个空字符串。 耗时操作
pageSize | 一次取多少条 |
cursor | 从这个游标位置开始取 |
HyphenateException |
List<EMChatRoom> com.hyphenate.chat.EMChatRoomManager.getAllChatRooms | ( | ) |
获取当前内存的聊天室
EMChatRoom com.hyphenate.chat.EMChatRoomManager.getChatRoom | ( | String | roomId | ) |
从内存中获取聊天室 非耗时操作
roomId |
void com.hyphenate.chat.EMChatRoomManager.joinChatRoom | ( | final String | roomId, |
final EMValueCallBack< EMChatRoom > | callback | ||
) |
加入聊天室,异步方法
roomId | |
callback |
void com.hyphenate.chat.EMChatRoomManager.leaveChatRoom | ( | final String | roomId | ) |
离开聊天室,异步方法
roomId |
EMChatRoom com.hyphenate.chat.EMChatRoomManager.muteChatRoomMembers | ( | String | chatRoomId, |
List< String > | muteMembers, | ||
long | duration | ||
) | throws HyphenateException |
禁止聊天室成员发言,需要聊天室拥有者或者管理员权限
chatRoomId | |
muteMembers | 禁言的用户列表 |
duration | 禁言的时间,单位是毫秒 |
HyphenateException |
EMChatRoom com.hyphenate.chat.EMChatRoomManager.removeChatRoomAdmin | ( | String | chatRoomId, |
String | admin | ||
) | throws HyphenateException |
删除聊天室管理员,需要拥有者权限
chatRoomId | |
admin |
HyphenateException |
void com.hyphenate.chat.EMChatRoomManager.removeChatRoomChangeListener | ( | EMChatRoomChangeListener | listener | ) |
void com.hyphenate.chat.EMChatRoomManager.removeChatRoomListener | ( | EMChatRoomChangeListener | listener | ) |
移除聊天室事件监听
listener |
EMChatRoom com.hyphenate.chat.EMChatRoomManager.removeChatRoomMembers | ( | String | chatRoomId, |
List< String > | members | ||
) | throws HyphenateException |
删除聊天室成员,需要拥有者或者管理员权限
chatRoomId | |
members |
HyphenateException |
EMChatRoom com.hyphenate.chat.EMChatRoomManager.unblockChatRoomMembers | ( | String | chatRoomId, |
List< String > | members | ||
) | throws HyphenateException |
将成员从黑名单种移除,需要拥有者或者管理员权限
chatRoomId | |
members |
HyphenateException |
EMChatRoom com.hyphenate.chat.EMChatRoomManager.unMuteChatRoomMembers | ( | String | chatRoomId, |
List< String > | members | ||
) | throws HyphenateException |
取消禁言,需要聊天室拥有者或者管理员权限
chatRoomId | |
members |
HyphenateException |
void com.hyphenate.chat.EMChatRoomManager.updateChatRoomAnnouncement | ( | String | chatRoomId, |
String | announcement | ||
) | throws HyphenateException |
更新聊天室公告
chatRoomId | 聊天室id |
announcement | 公告内容 |
HyphenateException |