hyphenate_SDK3.0
3.6.0
hyphenatejavaIMSDK
|
类 | |
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 | 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 | saveBlackList (List< String > blackList) throws HyphenateException |
void | asyncSaveBlackList (final List< String > blackList, final EMCallBack 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 > | getSelfIdsOnOtherPlatform () throws HyphenateException |
void | aysncGetSelfIdsOnOtherPlatform (final EMValueCallBack< List< String >> callback) |
EMContactManager 用来记录,查询,修改 用户的联系人/好友列表 它主要负责: 登陆后从环信服务器获取联系人列表 添加联系人 删除联系人 刷新联系人列表
如果应用自己管理联系人/好友列表,则不需要使用此 EMContactManager EMChatOptions.setUseRoster(false);
void com.hyphenate.chat.EMContactManager.acceptInvitation | ( | String | username | ) | throws HyphenateException |
接受加好友的邀请
username |
void com.hyphenate.chat.EMContactManager.addContact | ( | String | username, |
String | reason | ||
) | throws HyphenateException |
添加联系人
同步方法,会阻塞当前线程
username | 用户名 |
reason | 原因、理由(optional. use "" or null) |
HyphenateException |
void com.hyphenate.chat.EMContactManager.addUserToBlackList | ( | String | username, |
boolean | both | ||
) | throws HyphenateException |
把指定用户加入到黑名单中
同步方法,会阻塞当前线程
username | 此用户的username |
both | 把用户加入黑民单时,如果是both双方发消息时对方都收不到;如果不是, 则我能给黑名单的中用户发消息,但是对方发给我时我是收不到的 |
HyphenateException |
void com.hyphenate.chat.EMContactManager.asyncAcceptInvitation | ( | final String | username, |
final EMCallBack | callback | ||
) |
接受加好友的邀请
username | |
callback |
void com.hyphenate.chat.EMContactManager.asyncDeclineInvitation | ( | final String | username, |
final EMCallBack | callback | ||
) |
拒绝加好友的邀请
username | |
callback |
void com.hyphenate.chat.EMContactManager.asyncSaveBlackList | ( | final List< String > | blackList, |
final EMCallBack | callback | ||
) |
保存黑名单列表
blackList | |
callback |
void com.hyphenate.chat.EMContactManager.aysncAddContact | ( | final String | username, |
final String | reason, | ||
final EMCallBack | callback | ||
) |
添加联系人
username | 用户名 |
reason | 原因、理由(optional) |
callback |
void com.hyphenate.chat.EMContactManager.aysncAddUserToBlackList | ( | final String | username, |
final boolean | both, | ||
final EMCallBack | callback | ||
) |
把指定用户加入到黑名单中
username | 此用户的username |
both | 把用户加入黑民单时,如果是both双方发消息时对方都收不到;如果不是, 则我能给黑名单的中用户发消息,但是对方发给我时我是收不到的 |
callback |
void com.hyphenate.chat.EMContactManager.aysncDeleteContact | ( | final String | username, |
final EMCallBack | callback | ||
) |
删除好友
username | |
callback |
void com.hyphenate.chat.EMContactManager.aysncGetAllContactsFromServer | ( | final EMValueCallBack< List< String >> | callback | ) |
从服务器获取所有的好友
callback | 包含联系人列表 |
void com.hyphenate.chat.EMContactManager.aysncGetBlackListFromServer | ( | final EMValueCallBack< List< String >> | callback | ) |
从服务器获取黑名单中的用户的usernames
callback | 包含黑名单列表 |
void com.hyphenate.chat.EMContactManager.aysncGetSelfIdsOnOtherPlatform | ( | final EMValueCallBack< List< String >> | callback | ) |
从服务器获取登录用户在其他设备上登录的ID
callback | 包含用户在其他设备上登录的ID |
void com.hyphenate.chat.EMContactManager.aysncRemoveUserFromBlackList | ( | final String | username, |
final EMCallBack | callback | ||
) |
把用户从黑名单中移除
username | |
callback |
void com.hyphenate.chat.EMContactManager.declineInvitation | ( | String | username | ) | throws HyphenateException |
拒绝加好友的邀请
username |
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 |
从服务器获取所有的好友
同步方法,会阻塞当前线程
HyphenateException |
List<String> com.hyphenate.chat.EMContactManager.getBlackListFromServer | ( | ) | throws HyphenateException |
从服务器获取黑名单中的用户的usernames
HyphenateException |
List<String> com.hyphenate.chat.EMContactManager.getBlackListUsernames | ( | ) |
从本地获取黑名单中的用户的usernames
List<String> com.hyphenate.chat.EMContactManager.getSelfIdsOnOtherPlatform | ( | ) | throws HyphenateException |
从服务器获取登录用户在其他设备上登录的ID
HyphenateException |
void com.hyphenate.chat.EMContactManager.removeContactListener | ( | EMContactListener | contactListener | ) |
移除contact listener
void com.hyphenate.chat.EMContactManager.removeUserFromBlackList | ( | String | username | ) | throws HyphenateException |
把用户从黑名单中移除
同步方法,会阻塞当前线程
username |
HyphenateException |
void com.hyphenate.chat.EMContactManager.saveBlackList | ( | List< String > | blackList | ) | throws HyphenateException |
保存黑名单列表
同步方法,会阻塞当前线程
blackList |
void com.hyphenate.chat.EMContactManager.setContactListener | ( | EMContactListener | contactListener | ) |
应用通过此接口设置回调,获得联系人变化
contactListener |