IMSDK
IM features a comprehensive suite of solutions including global access, one-to-one chat, group chat, message push, profile and relationship chain hosting, and account authentication. It also provides complete app access and backend management APIs.
V2TIMFriendInfo

Public Member Functions

 V2TIMFriendInfo ()
 
String getUserID ()
 
void setUserID (String userID)
 
String getFriendRemark ()
 
void setFriendRemark (String friendRemark)
 
long getFriendAddTime ()
 
List< String > getFriendGroups ()
 
HashMap< String, byte[]> getFriendCustomInfo ()
 
void setFriendCustomInfo (HashMap< String, byte[]> customHashMap)
 
V2TIMUserFullInfo getUserProfile ()
 
String toString ()
 

Static Public Attributes

static final int V2TIM_FRIEND_TYPE_SINGLE = 1
 
static final int V2TIM_FRIEND_TYPE_BOTH = 2
 

Constructor & Destructor Documentation

◆ V2TIMFriendInfo()

V2TIMFriendInfo ( )
inline

Member Function Documentation

◆ getUserID()

String getUserID ( )
inline

Get the userID of a user

Returns
User's userID

◆ setUserID()

void setUserID ( String  userID)
inline

Set the userID of a user

Parameters
userIDUser's userID

◆ getFriendRemark()

String getFriendRemark ( )
inline

Get friend remarks

Returns
Remarks

◆ setFriendRemark()

void setFriendRemark ( String  friendRemark)
inline

Set friend remarks

Attention
  • The maximum length of friend remarks cannot exceed 96 bytes.
  • For field descriptions, see here.
Parameters
friendRemarkRemarks

◆ getFriendAddTime()

long getFriendAddTime ( )
inline

Get the UTC timestamp when a friend was added

◆ getFriendGroups()

List<String> getFriendGroups ( )
inline

Lists to which a friend belongs

Attention
  • A maximum of 32 lists are supported.
  • The list name cannot be empty.
  • The length of a list name cannot exceed 30 bytes
  • One user can be added to multiple friend lists.
  • For field descriptions, see here.

◆ getFriendCustomInfo()

HashMap<String, byte[]> getFriendCustomInfo ( )
inline

Get custom friend fields

Returns
Custom fields

◆ setFriendCustomInfo()

void setFriendCustomInfo ( HashMap< String, byte[]>  customHashMap)
inline

Set a custom friend field

Attention
You need to configure custom fields in the console first (Configuration -> Custom Friend Fields). Then you can call this API to set the custom fields. You don't need to add the Tag_SNS_Custom_ prefix for keys.
Parameters
customHashMapCustom fields

◆ getUserProfile()

V2TIMUserFullInfo getUserProfile ( )
inline

Get the user profile of a friend

Returns
User profile

◆ toString()

String toString ( )
inline

Field Documentation

◆ V2TIM_FRIEND_TYPE_SINGLE

final int V2TIM_FRIEND_TYPE_SINGLE = 1
static

One-way friend

◆ V2TIM_FRIEND_TYPE_BOTH

final int V2TIM_FRIEND_TYPE_BOTH = 2
static

Two-way friend