hyphenate_SDK3.0
3.8.6.1
hyphenate java IM SDK
|
类 | |
class | EMAContactListenerImpl |
Public 成员函数 | |
void | addContact (String username, String reason) throws HyphenateException |
void | aysncAddContact (final String username, final String reason, final EMCallBack callback) |
void | deleteContact (String username) throws HyphenateException |
void | deleteContact (String username, boolean keepConversation) throws HyphenateException |
void | aysncDeleteContact (final String username, final EMCallBack callback) |
List< String > | getAllContactsFromServer () throws HyphenateException |
void | aysncGetAllContactsFromServer (final EMValueCallBack< List< String >> callback) |
void | setContactListener (EMContactListener contactListener) |
void | removeContactListener (EMContactListener contactListener) |
void | addUserToBlackList (String username, boolean both) throws HyphenateException |
void | aysncAddUserToBlackList (final String username, final boolean both, final EMCallBack callback) |
void | saveBlackList (List< String > blackList) throws HyphenateException |
void | asyncSaveBlackList (final List< String > blackList, final EMCallBack callback) |
void | removeUserFromBlackList (String username) throws HyphenateException |
void | aysncRemoveUserFromBlackList (final String username, final EMCallBack callback) |
List< String > | getBlackListUsernames () |
List< String > | getBlackListFromServer () throws HyphenateException |
void | aysncGetBlackListFromServer (final EMValueCallBack< List< String >> callback) |
void | acceptInvitation (String username) throws HyphenateException |
void | asyncAcceptInvitation (final String username, final EMCallBack callback) |
void | declineInvitation (String username) throws HyphenateException |
void | asyncDeclineInvitation (final String username, final EMCallBack callback) |
List< String > | getContactsFromLocal () throws HyphenateException |
List< String > | getSelfIdsOnOtherPlatform () throws HyphenateException |
void | aysncGetSelfIdsOnOtherPlatform (final EMValueCallBack< List< String >> callback) |
EMContactManager用来记录,查询,修改用户的联系人/好友列表
void com.hyphenate.chat.EMContactManager.acceptInvitation | ( | String | username | ) | throws HyphenateException |
void com.hyphenate.chat.EMContactManager.addContact | ( | String | username, |
String | reason | ||
) | throws HyphenateException |
添加联系人 异步方法见aysncAddContact(String, String, EMCallBack)
同步方法,会阻塞当前线程
username | 用户名 |
reason | 原因、理由(optional. use "" or null) |
HyphenateException |
void com.hyphenate.chat.EMContactManager.addUserToBlackList | ( | String | username, |
boolean | both | ||
) | throws HyphenateException |
把指定用户加入到黑名单中 可以给黑名单的中用户发消息,但是接收不到对方发送的消息 异步方法见aysncAddUserToBlackList(String, boolean, EMCallBack) 批量加入黑名单见saveBlackList(List)
同步方法,会阻塞当前线程
username | 此用户ID |
both | 此参数已废弃 |
HyphenateException |
void com.hyphenate.chat.EMContactManager.asyncAcceptInvitation | ( | final String | username, |
final EMCallBack | callback | ||
) |
void com.hyphenate.chat.EMContactManager.asyncDeclineInvitation | ( | final String | username, |
final EMCallBack | callback | ||
) |
void com.hyphenate.chat.EMContactManager.asyncSaveBlackList | ( | final List< String > | blackList, |
final EMCallBack | callback | ||
) |
上传黑名单列表到服务器 同步方法见saveBlackList(List)
blackList | |
callback |
void com.hyphenate.chat.EMContactManager.aysncAddContact | ( | final String | username, |
final String | reason, | ||
final EMCallBack | callback | ||
) |
添加联系人 同步方法见addContact(String, String)
username | 用户名 |
reason | 原因、理由(optional) |
callback |
void com.hyphenate.chat.EMContactManager.aysncAddUserToBlackList | ( | final String | username, |
final boolean | both, | ||
final EMCallBack | callback | ||
) |
把指定用户加入到黑名单中 可以给黑名单的中用户发消息,但是接收不到对方发送的消息 同步方法见addUserToBlackList(String, boolean) 批量加入黑名单见asyncSaveBlackList(List, EMCallBack)
username | 此用户ID |
both | 此参数已废弃 |
callback |
void com.hyphenate.chat.EMContactManager.aysncDeleteContact | ( | final String | username, |
final EMCallBack | callback | ||
) |
删除好友 同步方法见deleteContact(String)
username | 要删除的用户ID |
callback |
void com.hyphenate.chat.EMContactManager.aysncGetAllContactsFromServer | ( | final EMValueCallBack< List< String >> | callback | ) |
从服务器获取所有的好友 同步方法见getAllContactsFromServer()
callback | 包含联系人列表 |
void com.hyphenate.chat.EMContactManager.aysncGetBlackListFromServer | ( | final EMValueCallBack< List< String >> | callback | ) |
从服务器获取黑名单列表 同步方法见getBlackListFromServer()
callback | 包含黑名单列表 |
void com.hyphenate.chat.EMContactManager.aysncGetSelfIdsOnOtherPlatform | ( | final EMValueCallBack< List< String >> | callback | ) |
void com.hyphenate.chat.EMContactManager.aysncRemoveUserFromBlackList | ( | final String | username, |
final EMCallBack | callback | ||
) |
把用户从黑名单中移除 同步方法见removeUserFromBlackList(String)
username | |
callback |
void com.hyphenate.chat.EMContactManager.declineInvitation | ( | String | username | ) | throws HyphenateException |
void com.hyphenate.chat.EMContactManager.deleteContact | ( | String | username | ) | throws HyphenateException |
删除好友及其相关的会话
同步方法,会阻塞当前线程
username |
HyphenateException |
void com.hyphenate.chat.EMContactManager.deleteContact | ( | String | username, |
boolean | keepConversation | ||
) | throws HyphenateException |
删除好友
同步方法,会阻塞当前线程
username | |
keepConversation | 是否保留会话和消息 |
HyphenateException |
List<String> com.hyphenate.chat.EMContactManager.getAllContactsFromServer | ( | ) | throws HyphenateException |
从服务器获取所有的好友 异步方法见aysncGetAllContactsFromServer(EMValueCallBack)
同步方法,会阻塞当前线程
HyphenateException |
List<String> com.hyphenate.chat.EMContactManager.getBlackListFromServer | ( | ) | throws HyphenateException |
List<String> com.hyphenate.chat.EMContactManager.getBlackListUsernames | ( | ) |
从本地获取黑名单列表
List<String> com.hyphenate.chat.EMContactManager.getContactsFromLocal | ( | ) | throws HyphenateException |
从数据库获取好友列表
HyphenateException |
List<String> com.hyphenate.chat.EMContactManager.getSelfIdsOnOtherPlatform | ( | ) | throws HyphenateException |
从服务器获取登录用户在其他设备上登录的ID 异步方法见aysncGetSelfIdsOnOtherPlatform(EMValueCallBack)
同步方法,会阻塞当前线程
HyphenateException |
void com.hyphenate.chat.EMContactManager.removeContactListener | ( | EMContactListener | contactListener | ) |
移除联系人监听 添加联系人监听调用setContactListener(EMContactListener)
void com.hyphenate.chat.EMContactManager.removeUserFromBlackList | ( | String | username | ) | throws HyphenateException |
把用户从黑名单中移除 异步方法见aysncRemoveUserFromBlackList(String, EMCallBack)
同步方法,会阻塞当前线程
username |
HyphenateException |
void com.hyphenate.chat.EMContactManager.saveBlackList | ( | List< String > | blackList | ) | throws HyphenateException |
void com.hyphenate.chat.EMContactManager.setContactListener | ( | EMContactListener | contactListener | ) |
注册联系人监听 调用removeContactListener(EMContactListener)移除监听
contactListener |