TencentImSDKPlugin.v2TIMManager.getFriendshipManager()
中。// 添加关系链监听器const frindshipListener = {onBlackListAdd: (infoList) => {},onBlackListDeleted: (userids) => {},onFriendApplicationListAdded: (applicationlist) => {},onFriendApplicationListDeleted: (applicationlist) => {},onFriendApplicationListRead: () => {},onFriendInfoChanged: (frindInfolist) => {},onFriendListAdded: (frindInfolist) => {},onFriendListDeleted: (userd) => {},};friendshipManager.addFriendListener(frindshipListener);// 移除关系链监听器friendshipManager.removeFriendListener(frindshipListener);
// 获取个人资料const self = await TencentImSDKPlugin.v2TIMManager.getLoginUser();TencentImSDKPlugin.v2TIMManager.getUsersInfo([self.data]);// 设置个人资料TencentImSDKPlugin.v2TIMManager.setSelfInfo({nickName: "",role: 0,faceUrl: "",});
getFriendsInfo
(Details) 接口查询指定的好友资料,从回调信息中通过 V2TIMFriendInfoResult
的 relation
字段可以得到该用户与自己的关系:relation | 与自己的关系 |
V2TIM_FRIEND_RELATION_TYPE_NONE | 表示不是好友。 |
V2TIM_FRIEND_RELATION_TYPE_BOTH_WAY | 表示互为好友。 |
V2TIM_FRIEND_RELATION_TYPE_IN_MY_FRIEND_LIST | 表示对方在我的好友列表中。 |
V2TIM_FRIEND_RELATION_TYPE_IN_OTHER_FRIEND_LIST | 表示我在对方的好友列表中。 |
// 获取好友信息const friendsInfo = await friendshipManager.getFriendsInfo(["userID"]);
// 设置好友信息TencentImSDKPlugin.v2TIMManager.setSelfInfo({nickName: "",role: 0,faceUrl: "",});
本页内容是否解决了您的问题?