agora_chat_SDK  3.8.2
agorajavachatSDK
Classes | Public Member Functions | List of all members
io.agora.chat.ContactManager Class Reference

Classes

class  EMAContactListenerImpl
 

Public Member Functions

void addContact (String username, String reason) throws ChatException
 
void asyncAddContact (final String username, final String reason, final CallBack callback)
 
void deleteContact (String username) throws ChatException
 
void deleteContact (String username, boolean keepConversation) throws ChatException
 
void asyncDeleteContact (final String username, final CallBack callback)
 
List< String > getAllContactsFromServer () throws ChatException
 
void asyncGetAllContactsFromServer (final ValueCallBack< List< String >> callback)
 
void setContactListener (ContactListener contactListener)
 
void removeContactListener (ContactListener contactListener)
 
void addUserToBlackList (String username, boolean both) throws ChatException
 
void asyncAddUserToBlackList (final String username, final boolean both, final CallBack callback)
 
void saveBlackList (List< String > blackList) throws ChatException
 
void asyncSaveBlackList (final List< String > blackList, final CallBack callback)
 
void removeUserFromBlackList (String username) throws ChatException
 
void asyncRemoveUserFromBlackList (final String username, final CallBack callback)
 
List< String > getBlackListUsernames ()
 
List< String > getBlackListFromServer () throws ChatException
 
void asyncGetBlackListFromServer (final ValueCallBack< List< String >> callback)
 
void acceptInvitation (String username) throws ChatException
 
void asyncAcceptInvitation (final String username, final CallBack callback)
 
void declineInvitation (String username) throws ChatException
 
void asyncDeclineInvitation (final String username, final CallBack callback)
 
List< String > getContactsFromLocal () throws ChatException
 
List< String > getSelfIdsOnOtherPlatform () throws ChatException
 
void asyncGetSelfIdsOnOtherPlatform (final ValueCallBack< List< String >> callback)
 

Detailed Description

ContactManager is used to manage friends, including recording, querying, modifying and so on

Member Function Documentation

void io.agora.chat.ContactManager.acceptInvitation ( String  username) throws ChatException

Accept a friend invitation Asynchronously method see asyncAcceptInvitation(String, CallBack)

Synchronization method will block the current thread

Parameters
username
void io.agora.chat.ContactManager.addContact ( String  username,
String  reason 
) throws ChatException

Add a new user Asynchronously method see asyncAddContact(String, String, CallBack)

Synchronization method will block the current thread

Parameters
usernameThe user to add
reasonmessage for adding contact (optional. use "" or null))
Exceptions
ChatException
void io.agora.chat.ContactManager.addUserToBlackList ( String  username,
boolean  both 
) throws ChatException

Add a user to blacklist You can send message to the user in blacklist, but you can not receive the message sent by the other Asynchronously method see asyncAddUserToBlackList(String, boolean, CallBack) Add batch blacklist to see saveBlackList(List)

Synchronization method will block the current thread

Parameters
usernameUser to be blocked
bothThis parameter is deprecated
Exceptions
ChatException
void io.agora.chat.ContactManager.asyncAcceptInvitation ( final String  username,
final CallBack  callback 
)

Accept a friend invitation Synchronization method see acceptInvitation(String)

Asynchronously method

Parameters
username
callback
void io.agora.chat.ContactManager.asyncAddContact ( final String  username,
final String  reason,
final CallBack  callback 
)

Add a new user Synchronization method see addContact(String, String)

Parameters
usernameuser id
reasonmessage for adding contact (optional)
callback
void io.agora.chat.ContactManager.asyncAddUserToBlackList ( final String  username,
final boolean  both,
final CallBack  callback 
)

Add the user to blacklist You can send message to the user in blacklist, but you can not receive the message sent by the other Synchronization method see addUserToBlackList(String, boolean) Add batch blacklist to see asyncSaveBlackList(List, CallBack)

Parameters
usernameUser to be blocked
bothThis parameter is deprecated
callback
void io.agora.chat.ContactManager.asyncDeclineInvitation ( final String  username,
final CallBack  callback 
)

Decline a friend invitation Synchronization method see declineInvitation(String)

Asynchronously method

Parameters
username
callback
void io.agora.chat.ContactManager.asyncDeleteContact ( final String  username,
final CallBack  callback 
)

Delete a contact Synchronization method see deleteContact(String)

Parameters
usernameThe user to delete
callback
void io.agora.chat.ContactManager.asyncGetAllContactsFromServer ( final ValueCallBack< List< String >>  callback)

Get all contacts from the server Synchronization method see getAllContactsFromServer()

Parameters
callbackContains list of contacts
void io.agora.chat.ContactManager.asyncGetBlackListFromServer ( final ValueCallBack< List< String >>  callback)

Get blacklist from server Synchronization method see getBlackListFromServer()

Parameters
callbackContains black list
void io.agora.chat.ContactManager.asyncGetSelfIdsOnOtherPlatform ( final ValueCallBack< List< String >>  callback)

Get IDs of current user on other platform Synchronization method see getSelfIdsOnOtherPlatform()

Asynchronously method

Parameters
callbackContains self id list on other platform
void io.agora.chat.ContactManager.asyncRemoveUserFromBlackList ( final String  username,
final CallBack  callback 
)

Remove the contact from blacklist Synchronization method see removeUserFromBlackList(String)

Parameters
username
callback
void io.agora.chat.ContactManager.asyncSaveBlackList ( final List< String >  blackList,
final CallBack  callback 
)

Upload blacklist to server Synchronization method see saveBlackList(List)

Parameters
blackList
callback
void io.agora.chat.ContactManager.declineInvitation ( String  username) throws ChatException

Decline a friend invitation Asynchronously method see asyncDeclineInvitation(String, CallBack)

Synchronization method will block the current thread

Parameters
username
void io.agora.chat.ContactManager.deleteContact ( String  username) throws ChatException

Delete a contact and all the conversations associated

Synchronization method will block the current thread

Parameters
username
Exceptions
ChatException
void io.agora.chat.ContactManager.deleteContact ( String  username,
boolean  keepConversation 
) throws ChatException

Delete a contact

Synchronization method will block the current thread

Parameters
username
keepConversationIf to keep the associated conversation and messages
Exceptions
ChatException
List<String> io.agora.chat.ContactManager.getAllContactsFromServer ( ) throws ChatException

Get all contacts from the server Asynchronously method see asyncGetAllContactsFromServer(ValueCallBack)

Synchronization method will block the current thread

Returns
list of contacts
Exceptions
ChatException
List<String> io.agora.chat.ContactManager.getBlackListFromServer ( ) throws ChatException

Get local blacklist Asynchronously method see asyncGetBlackListFromServer(ValueCallBack)

Synchronization method will block the current thread

Returns
Exceptions
ChatException
List<String> io.agora.chat.ContactManager.getBlackListUsernames ( )

Get local blacklist

Returns
List
List<String> io.agora.chat.ContactManager.getContactsFromLocal ( ) throws ChatException

Get contacts from local database

Returns
contact list
Exceptions
ChatException
List<String> io.agora.chat.ContactManager.getSelfIdsOnOtherPlatform ( ) throws ChatException

Get IDs of current user on other platform Asynchronously method see asyncGetSelfIdsOnOtherPlatform(ValueCallBack)

Synchronization method will block the current thread

Returns
Exceptions
ChatException
void io.agora.chat.ContactManager.removeContactListener ( ContactListener  contactListener)

Remove contact listener Add contact listener calls setContactListener(ContactListener)

void io.agora.chat.ContactManager.removeUserFromBlackList ( String  username) throws ChatException

Remove the contact from blacklist Asynchronously method see asyncRemoveUserFromBlackList(String, CallBack)

Synchronization method will block the current thread

Parameters
username
Exceptions
ChatException
void io.agora.chat.ContactManager.saveBlackList ( List< String >  blackList) throws ChatException

Upload blacklist to server Asynchronously method see asyncSaveBlackList(List, CallBack)

Synchronization method will block the current thread

Parameters
blackList
void io.agora.chat.ContactManager.setContactListener ( ContactListener  contactListener)

Register new contact listener Call removeContactListener(ContactListener) to remove listener

Parameters
contactListener

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