|
class | EMAContactListenerImpl |
|
|
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);
◆ acceptInvitation()
void com.hyphenate.chat.EMContactManager.acceptInvitation |
( |
String |
username | ) |
throws HyphenateException |
◆ addContact()
void com.hyphenate.chat.EMContactManager.addContact |
( |
String |
username, |
|
|
String |
reason |
|
) |
| throws HyphenateException |
添加联系人
同步方法,会阻塞当前线程
- 参数
-
username | 用户名 |
reason | 原因、理由(optional. use "" or null) |
- 异常
-
◆ addUserToBlackList()
void com.hyphenate.chat.EMContactManager.addUserToBlackList |
( |
String |
username, |
|
|
boolean |
both |
|
) |
| throws HyphenateException |
把指定用户加入到黑名单中
同步方法,会阻塞当前线程
- 参数
-
username | 此用户的username |
both | 把用户加入黑民单时,如果是both双方发消息时对方都收不到;如果不是, 则我能给黑名单的中用户发消息,但是对方发给我时我是收不到的 |
- 异常
-
◆ asyncAcceptInvitation()
void com.hyphenate.chat.EMContactManager.asyncAcceptInvitation |
( |
final String |
username, |
|
|
final EMCallBack |
callback |
|
) |
| |
◆ asyncDeclineInvitation()
void com.hyphenate.chat.EMContactManager.asyncDeclineInvitation |
( |
final String |
username, |
|
|
final EMCallBack |
callback |
|
) |
| |
◆ asyncSaveBlackList()
void com.hyphenate.chat.EMContactManager.asyncSaveBlackList |
( |
final List< String > |
blackList, |
|
|
final EMCallBack |
callback |
|
) |
| |
◆ aysncAddContact()
void com.hyphenate.chat.EMContactManager.aysncAddContact |
( |
final String |
username, |
|
|
final String |
reason, |
|
|
final EMCallBack |
callback |
|
) |
| |
添加联系人
- 参数
-
username | 用户名 |
reason | 原因、理由(optional) |
callback | |
◆ aysncAddUserToBlackList()
void com.hyphenate.chat.EMContactManager.aysncAddUserToBlackList |
( |
final String |
username, |
|
|
final boolean |
both, |
|
|
final EMCallBack |
callback |
|
) |
| |
把指定用户加入到黑名单中
- 参数
-
username | 此用户的username |
both | 把用户加入黑民单时,如果是both双方发消息时对方都收不到;如果不是, 则我能给黑名单的中用户发消息,但是对方发给我时我是收不到的 |
callback | |
◆ aysncDeleteContact()
void com.hyphenate.chat.EMContactManager.aysncDeleteContact |
( |
final String |
username, |
|
|
final EMCallBack |
callback |
|
) |
| |
◆ aysncGetAllContactsFromServer()
void com.hyphenate.chat.EMContactManager.aysncGetAllContactsFromServer |
( |
final EMValueCallBack< List< String >> |
callback | ) |
|
◆ aysncGetBlackListFromServer()
void com.hyphenate.chat.EMContactManager.aysncGetBlackListFromServer |
( |
final EMValueCallBack< List< String >> |
callback | ) |
|
从服务器获取黑名单中的用户的usernames
- 参数
-
◆ aysncGetSelfIdsOnOtherPlatform()
void com.hyphenate.chat.EMContactManager.aysncGetSelfIdsOnOtherPlatform |
( |
final EMValueCallBack< List< String >> |
callback | ) |
|
◆ aysncRemoveUserFromBlackList()
void com.hyphenate.chat.EMContactManager.aysncRemoveUserFromBlackList |
( |
final String |
username, |
|
|
final EMCallBack |
callback |
|
) |
| |
◆ declineInvitation()
void com.hyphenate.chat.EMContactManager.declineInvitation |
( |
String |
username | ) |
throws HyphenateException |
◆ deleteContact() [1/2]
void com.hyphenate.chat.EMContactManager.deleteContact |
( |
String |
username | ) |
throws HyphenateException |
◆ deleteContact() [2/2]
void com.hyphenate.chat.EMContactManager.deleteContact |
( |
String |
username, |
|
|
boolean |
keepConversation |
|
) |
| throws HyphenateException |
删除好友
同步方法,会阻塞当前线程
- 参数
-
username | |
keepConversation | 是否保留会话和消息 |
- 异常
-
◆ getAllContactsFromServer()
List<String> com.hyphenate.chat.EMContactManager.getAllContactsFromServer |
( |
| ) |
throws HyphenateException |
从服务器获取所有的好友
同步方法,会阻塞当前线程
- 返回
- 联系人列表
- 异常
-
◆ getBlackListFromServer()
List<String> com.hyphenate.chat.EMContactManager.getBlackListFromServer |
( |
| ) |
throws HyphenateException |
从服务器获取黑名单中的用户的usernames
- 返回
- 异常
-
◆ getBlackListUsernames()
List<String> com.hyphenate.chat.EMContactManager.getBlackListUsernames |
( |
| ) |
|
从本地获取黑名单中的用户的usernames
- 返回
- List
◆ getSelfIdsOnOtherPlatform()
List<String> com.hyphenate.chat.EMContactManager.getSelfIdsOnOtherPlatform |
( |
| ) |
throws HyphenateException |
从服务器获取登录用户在其他设备上登录的ID
- 返回
- 异常
-
◆ removeContactListener()
void com.hyphenate.chat.EMContactManager.removeContactListener |
( |
EMContactListener |
contactListener | ) |
|
◆ removeUserFromBlackList()
void com.hyphenate.chat.EMContactManager.removeUserFromBlackList |
( |
String |
username | ) |
throws HyphenateException |
把用户从黑名单中移除
同步方法,会阻塞当前线程
- 参数
-
- 异常
-
◆ saveBlackList()
void com.hyphenate.chat.EMContactManager.saveBlackList |
( |
List< String > |
blackList | ) |
throws HyphenateException |
◆ setContactListener()
void com.hyphenate.chat.EMContactManager.setContactListener |
( |
EMContactListener |
contactListener | ) |
|
该类的文档由以下文件生成:
- hyphenatechatsdk/src/com/hyphenate/chat/EMContactManager.java