Chat SDK for Android v1.2.1
agora java chat SDK
Public Member Functions | List of all members
io.agora.ContactListener Interface Reference

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)
 

Detailed Description

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:

ChatClient.getInstance().contactManager().setContactListener(mContactListener);

Unregister listener:

ChatClient.getInstance().contactManager().removeContactListener(mContactListener);

Member Function Documentation

◆ onContactAdded()

void io.agora.ContactListener.onContactAdded ( String  username)

Occurs when user is added as a contact by another user.

Parameters
usernameThe new contact to be added.

◆ onContactDeleted()

void io.agora.ContactListener.onContactDeleted ( String  username)

Occurs when a user is removed from the contact list by another user.

Parameters
usernameThe user who is removed from the contact list by another user.

◆ onContactInvited()

void io.agora.ContactListener.onContactInvited ( String  username,
String  reason 
)

Occurs when a user receives a friend request.

Parameters
usernameThe user who initiated the friend request.
reasonThe invitation message.

◆ onFriendRequestAccepted()

void io.agora.ContactListener.onFriendRequestAccepted ( String  username)

Occurs when a friend request is approved.

Parameters
usernameThe user who initiated the friend request.

◆ onFriendRequestDeclined()

void io.agora.ContactListener.onFriendRequestDeclined ( String  username)

Occurs when a friend request is declined.

Parameters
usernameThe user who initiated the friend request.

The documentation for this interface was generated from the following file: