hyphenate_SDK4.0 5.0.0
hyphenate java IM SDK
 
Loading...
Searching...
No Matches
com.hyphenate.chat.EMUserInfoManager Class Reference

Public Member Functions

void addUserInfoManagerListener (EMUserInfoManagerListener listener)
 
void removeUserInfoManagerListener (EMUserInfoManagerListener listener)
 
void updateOwnInfo (final EMUserInfo userInfo, final EMValueCallBack< String > callBack)
 
void updateOwnInfoByAttribute (final EMUserInfoType attribute, final String value, final EMValueCallBack< String > callBack)
 
void fetchUserInfoByUserId (final String[] userIds, final EMValueCallBack< Map< String, EMUserInfo > > callBack)
 
void fetchUserInfoByAttribute (final String[] userIds, final EMUserInfoType[] attributes, EMValueCallBack< Map< String, EMUserInfo > > callBack)
 
void subscribeUsersInfo (final String[] userIds, final EMCallBack callback)
 
void unsubscribeUsersInfo (final String[] userIds, final EMCallBack callback)
 
void fetchSubscribedUsers (final EMValueCallBack< List< EMUserInfo > > callback)
 
EMUserInfo getUserInfoWithUserId (String userId) throws HyphenateException
 
void getUserInfoWithUserIds (String[] userIds, final EMValueCallBack< Map< String, EMUserInfo > > callback)
 

Detailed Description

The user attribute manager for updating and getting user attributes.

Member Function Documentation

◆ addUserInfoManagerListener()

void com.hyphenate.chat.EMUserInfoManager.addUserInfoManagerListener ( EMUserInfoManagerListener listener)

Adds a listener for user attribute updates.

Parameters
listenerThe listener to add.

◆ fetchSubscribedUsers()

void com.hyphenate.chat.EMUserInfoManager.fetchSubscribedUsers ( final EMValueCallBack< List< EMUserInfo > > callback)

Gets user attributes of strangers whose attribute update events are subscribed to.

Parameters
callbackThe result callback:

◆ fetchUserInfoByAttribute()

void com.hyphenate.chat.EMUserInfoManager.fetchUserInfoByAttribute ( final String[] userIds,
final EMUserInfoType[] attributes,
EMValueCallBack< Map< String, EMUserInfo > > callBack )

Gets any single or multiple attributes of one or more users.

Parameters
userIdsThe user ID array.
attributesThe user attributes.
callBackThe result callback which contains the error information if the method fails. See EMCallBack.

◆ fetchUserInfoByUserId()

void com.hyphenate.chat.EMUserInfoManager.fetchUserInfoByUserId ( final String[] userIds,
final EMValueCallBack< Map< String, EMUserInfo > > callBack )

Gets user attributes by user ID.

Parameters
userIdsThe user ID array.
callBackThe result callback which contains the error information if the method fails. See EMCallBack.

◆ getUserInfoWithUserId()

EMUserInfo com.hyphenate.chat.EMUserInfoManager.getUserInfoWithUserId ( String userId) throws HyphenateException

Gets the user attributes of a user from the local memory.

This method retrieves user attributes from the local memory without making network requests.

This is a synchronous method and blocks the current thread.

Parameters
userIdThe user ID.
Returns
The user attributes. Returns null if the user does not exist in the local memory.
Exceptions
HyphenateExceptionThrown if the method call fails. The exception contains an error code and description. For details, see EMError.

◆ getUserInfoWithUserIds()

void com.hyphenate.chat.EMUserInfoManager.getUserInfoWithUserIds ( String[] userIds,
final EMValueCallBack< Map< String, EMUserInfo > > callback )

Gets user attributes by user ID from the local memory.

This method retrieves user attributes from the local memory without making network requests.

Parameters
userIdsThe user ID array.
callbackThe result callback:

◆ removeUserInfoManagerListener()

void com.hyphenate.chat.EMUserInfoManager.removeUserInfoManagerListener ( EMUserInfoManagerListener listener)

Removes a listener for user attribute updates.

Parameters
listenerThe listener to remove.

◆ subscribeUsersInfo()

void com.hyphenate.chat.EMUserInfoManager.subscribeUsersInfo ( final String[] userIds,
final EMCallBack callback )

Subscribes to user attribute update events of strangers by user ID.

Parameters
userIdsThe array of user IDs to subscribe to.
callbackThe result callback which contains the error information if the method fails. See EMCallBack.

◆ unsubscribeUsersInfo()

void com.hyphenate.chat.EMUserInfoManager.unsubscribeUsersInfo ( final String[] userIds,
final EMCallBack callback )

Unsubscribes from user attribute update events of strangers by user ID.

Parameters
userIdsThe array of user IDs to unsubscribe from.
callbackThe completion callback which contains the error message if the method fails.

◆ updateOwnInfo()

void com.hyphenate.chat.EMUserInfoManager.updateOwnInfo ( final EMUserInfo userInfo,
final EMValueCallBack< String > callBack )

Modifies the user attributes of the current user.

Parameters
userInfoThe user attributes to be modified.
callBackThe result callback which contains the error information if the method fails. See EMCallBack.

◆ updateOwnInfoByAttribute()

void com.hyphenate.chat.EMUserInfoManager.updateOwnInfoByAttribute ( final EMUserInfoType attribute,
final String value,
final EMValueCallBack< String > callBack )

Modifies attributes of the current user.

Parameters
attributeThe user attribute.
valueThe modified user attribute (if this parameter is set as null, the attribute field will be removed on the server).
callBackThe result callback which contains the error information if the method fails. See EMCallBack.

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