Public 成员函数 | |
| void | onContactAdded (String username) |
| void | onContactDeleted (String username) |
| void | onContactInvited (String username, String reason) |
| void | onFriendRequestAccepted (String username) |
| void | onFriendRequestDeclined (String username) |
| default void | onContactInfoUpdate (EMContact contact) |
联系人监听器。 监听联系人变化,包括添加好友的申请,对方删除好友的通知,对方同意好友请求,对方拒绝好友请求。
示例如下: 注册联系人监听: java EMClient.getInstance().contactManager().setContactListener(mContactListener);
解注册联系人监听: EMClient.getInstance().contactManager().removeContactListener(mContactListener);
| void com.hyphenate.EMContactListener.onContactAdded | ( | String | username | ) |
添加好友回调。
| username | 新增的好友。 |
| void com.hyphenate.EMContactListener.onContactDeleted | ( | String | username | ) |
被删除联系人时的回调。
| username | 删除的联系人。 |
| default void com.hyphenate.EMContactListener.onContactInfoUpdate | ( | EMContact | contact | ) |
好友信息变更时回调。
| contact | 好友对象,可通过 EMContact#getUserInfo() 获取好友信息。 |
| void com.hyphenate.EMContactListener.onContactInvited | ( | String | username, |
| String | reason ) |
收到好友邀请的回调。
| username | 发起好友请求的用户。 |
| reason | 对方发起好友邀请时发出的文字性描述。 |
| void com.hyphenate.EMContactListener.onFriendRequestAccepted | ( | String | username | ) |
好友请求被同意的回调。
| username | 发起好友请求的用户。 |
| void com.hyphenate.EMContactListener.onFriendRequestDeclined | ( | String | username | ) |
好友请求被拒绝的回调。
| username | 发起好友请求的用户。 |