hyphenate_SDK3.0  3.8.5
hyphenatejavaIMSDK
Classes | Public Member Functions | List of all members
com.hyphenate.chat.EMContactManager Class Reference

Classes

class  EMAContactListenerImpl
 

Public Member Functions

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 saveBlackList (List< String > blackList) throws HyphenateException
 
void asyncSaveBlackList (final List< String > blackList, 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 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 > getContactsFromLocal () throws HyphenateException
 
List< String > getSelfIdsOnOtherPlatform () throws HyphenateException
 
void aysncGetSelfIdsOnOtherPlatform (final EMValueCallBack< List< String >> callback)
 

Detailed Description

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

Member Function Documentation

void com.hyphenate.chat.EMContactManager.acceptInvitation ( String  username) throws HyphenateException

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

Synchronization method will block the current thread

Parameters
username
void com.hyphenate.chat.EMContactManager.addContact ( String  username,
String  reason 
) throws HyphenateException

Add a new user Asynchronously method see aysncAddContact(String, String, EMCallBack)

Synchronization method will block the current thread

Parameters
usernameThe user to add
reasonmessage for adding contact (optional. use "" or null))
Exceptions
HyphenateException
void com.hyphenate.chat.EMContactManager.addUserToBlackList ( String  username,
boolean  both 
) throws HyphenateException

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 aysncAddUserToBlackList(String, boolean, EMCallBack) Add batch blacklist to see saveBlackList(List)

Synchronization method will block the current thread

Parameters
usernameUser to be blocked
bothThis parameter is deprecated
Exceptions
HyphenateException
void com.hyphenate.chat.EMContactManager.asyncAcceptInvitation ( final String  username,
final EMCallBack  callback 
)

Accept a friend invitation Synchronization method see acceptInvitation(String)

Asynchronously method

Parameters
username
callback
void com.hyphenate.chat.EMContactManager.asyncDeclineInvitation ( final String  username,
final EMCallBack  callback 
)

Decline a friend invitation Synchronization method see declineInvitation(String)

Asynchronously method

Parameters
username
callback
void com.hyphenate.chat.EMContactManager.asyncSaveBlackList ( final List< String >  blackList,
final EMCallBack  callback 
)

Upload blacklist to server Synchronization method see saveBlackList(List)

Parameters
blackList
callback
void com.hyphenate.chat.EMContactManager.aysncAddContact ( final String  username,
final String  reason,
final EMCallBack  callback 
)

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

Parameters
usernameuser id
reasonmessage for adding contact (optional)
callback
void com.hyphenate.chat.EMContactManager.aysncAddUserToBlackList ( final String  username,
final boolean  both,
final EMCallBack  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, EMCallBack)

Parameters
usernameUser to be blocked
bothThis parameter is deprecated
callback
void com.hyphenate.chat.EMContactManager.aysncDeleteContact ( final String  username,
final EMCallBack  callback 
)

Delete a contact Synchronization method see deleteContact(String)

Parameters
usernameThe user to delete
callback
void com.hyphenate.chat.EMContactManager.aysncGetAllContactsFromServer ( final EMValueCallBack< List< String >>  callback)

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

Parameters
callbackContains list of contacts
void com.hyphenate.chat.EMContactManager.aysncGetBlackListFromServer ( final EMValueCallBack< List< String >>  callback)

Get blacklist from server Synchronization method see getBlackListFromServer()

Parameters
callbackContains black list
void com.hyphenate.chat.EMContactManager.aysncGetSelfIdsOnOtherPlatform ( final EMValueCallBack< 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 com.hyphenate.chat.EMContactManager.aysncRemoveUserFromBlackList ( final String  username,
final EMCallBack  callback 
)

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

Parameters
username
callback
void com.hyphenate.chat.EMContactManager.declineInvitation ( String  username) throws HyphenateException

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

Synchronization method will block the current thread

Parameters
username
void com.hyphenate.chat.EMContactManager.deleteContact ( String  username) throws HyphenateException

Delete a contact and all the conversations associated

Synchronization method will block the current thread

Parameters
username
Exceptions
HyphenateException
void com.hyphenate.chat.EMContactManager.deleteContact ( String  username,
boolean  keepConversation 
) throws HyphenateException

Delete a contact

Synchronization method will block the current thread

Parameters
username
keepConversationIf to keep the associated conversation and messages
Exceptions
HyphenateException
List<String> com.hyphenate.chat.EMContactManager.getAllContactsFromServer ( ) throws HyphenateException

Get all contacts from the server Asynchronously method see aysncGetAllContactsFromServer(EMValueCallBack)

Synchronization method will block the current thread

Returns
list of contacts
Exceptions
HyphenateException
List<String> com.hyphenate.chat.EMContactManager.getBlackListFromServer ( ) throws HyphenateException

Get local blacklist Asynchronously method see aysncGetBlackListFromServer(EMValueCallBack)

Synchronization method will block the current thread

Returns
Exceptions
HyphenateException
List<String> com.hyphenate.chat.EMContactManager.getBlackListUsernames ( )

Get local blacklist

Returns
List
List<String> com.hyphenate.chat.EMContactManager.getContactsFromLocal ( ) throws HyphenateException

Get contacts from local database

Returns
contact list
Exceptions
HyphenateException
List<String> com.hyphenate.chat.EMContactManager.getSelfIdsOnOtherPlatform ( ) throws HyphenateException

Get IDs of current user on other platform Asynchronously method see aysncGetSelfIdsOnOtherPlatform(EMValueCallBack)

Synchronization method will block the current thread

Returns
Exceptions
HyphenateException
void com.hyphenate.chat.EMContactManager.removeContactListener ( EMContactListener  contactListener)

Remove contact listener Add contact listener calls setContactListener(EMContactListener)

void com.hyphenate.chat.EMContactManager.removeUserFromBlackList ( String  username) throws HyphenateException

Remove the contact from blacklist Asynchronously method see aysncRemoveUserFromBlackList(String, EMCallBack)

Synchronization method will block the current thread

Parameters
username
Exceptions
HyphenateException
void com.hyphenate.chat.EMContactManager.saveBlackList ( List< String >  blackList) throws HyphenateException

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

Synchronization method will block the current thread

Parameters
blackList
void com.hyphenate.chat.EMContactManager.setContactListener ( EMContactListener  contactListener)

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

Parameters
contactListener

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