Public Member Functions | |
| 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) |
The contact updates listener.
Listen for the contact changes, including requests to add friends, notifications to delete friends, requests to accept friends, and requests to reject friends.
Register listener:
Unregister listener:
| void com.hyphenate.EMContactListener.onContactAdded | ( | String | username | ) |
Occurs when a user is added as a contact by another user.
| username | The new contact to add. |
| void com.hyphenate.EMContactListener.onContactDeleted | ( | String | username | ) |
Occurs when a user is removed from the contact list by another user.
| username | The user who is removed from the contact list by another user. |
| default void com.hyphenate.EMContactListener.onContactInfoUpdate | ( | EMContact | contact | ) |
Occurs when contact information changes.
| contact | The contact object. You can call EMContact#getUserInfo() to retrieve the contact information. |
| void com.hyphenate.EMContactListener.onContactInvited | ( | String | username, |
| String | reason ) |
Occurs when a user receives a friend request.
| username | The user who initiated the friend request. |
| reason | The invitation message. |
| void com.hyphenate.EMContactListener.onFriendRequestAccepted | ( | String | username | ) |
Occurs when a friend request is approved.
| username | The user who initiated the friend request. |
| void com.hyphenate.EMContactListener.onFriendRequestDeclined | ( | String | username | ) |
Occurs when a friend request is declined.
| username | The user who initiated the friend request. |