Unfollowed Status | Followed Status | Broadcaster Info Panel |
| | |
// File location:Android/tuilivekit/src/Main/java/com/trtc/uikit/livekit/common/uicomponent/
roominfo // Directory for implementing the live room information UI component├── RoomInfoDetailView.java // Specific implementation of the Live Room Information Details Panel View└── RoomInfoView.java // Specific implementation of the Live Room Information View. Clicking this view will show the Details Panel View
// File location:TUILiveKit/iOS/TUILiveKit/Sources/Component/LiveInfo/
LiveInfo // Implementation directory of Live Room Information UI Component├── LiveInfoView.swift // Detailed implementation of Live Room Information Panel View└── View└── LiveInfoPanelView.swift // Detailed implementation of Live Room Information View, clicking this view will display the detailed panel view
// File location:Android/tuilivekit
/src/Main/java/com/trtc/uikit/livekit/service/impl/LiveServiceImpl.javaList<String> userIDList = new ArrayList<>();userIDList.add("userId");V2TIMManager.getFriendshipManager().followUser(userIDList,new V2TIMValueCallback<List<V2TIMFollowOperationResult>>() {@Overridepublic void onSuccess(List<V2TIMFollowOperationResult> results) {}@Overridepublic void onError(int code, String message) {}});
// File location:TUILiveKit/iOS/TUILiveKit/Sources/Component/LiveInfo/RoomInfoService
public func followUser(userId: String) {let userInfo = TUIUserInfo()userInfo.userId = userIdV2TIMManager.sharedInstance().followUser([userId]) { [weak self] followResultList inguard let self = self, let result = followResultList?.first else { return }if result.resultCode == 0, !self.state.followingList.contains(where: { $0.userId == userId }) {self.state.followingList.insert(userInfo)self.getFansNumber()}} fail: { code, message indebugPrint("[RoomInfo] followUser failed, error:\\(code), message:\\(String(describing: message))")}}
// File location:Android/tuilivekit
/src/Main/java/com/trtc/uikit/livekit/service/impl/LiveServiceImpl.javaList<String> userIDList = new ArrayList<>();userIDList.add("userId");V2TIMManager.getFriendshipManager().unfollowUser(userIDList,new V2TIMValueCallback<List<V2TIMFollowOperationResult>>() {@Overridepublic void onSuccess(List<V2TIMFollowOperationResult> results) {}@Overridepublic void onError(int code, String message) {}});
// File location:TUILiveKit/iOS/TUILiveKit/Sources/Component/LiveInfo/RoomInfoService
public func unfollowUser(userId: String) {V2TIMManager.sharedInstance().unfollowUser([userId]) { [weak self] followResultList inguard let self = self, let result = followResultList?.first else { return }if result.resultCode == 0 {self.state.followingList = state.followingList.filter { $0.userId != userId}}} fail: { code, message indebugPrint("[RoomInfo] unfollowUser failed, error:\\(code), message:\\(String(describing: message))")}}
// File location:Android/tuilivekit
/src/Main/java/com/trtc/uikit/livekit/service/impl/LiveServiceImpl.javaList<String> userIDList = new ArrayList<>();userIDList.add("userId");V2TIMManager.getFriendshipManager().checkFollowType(userIDList,new V2TIMValueCallback<List<V2TIMFollowTypeCheckResult>>() {@Overridepublic void onSuccess(List<V2TIMFollowTypeCheckResult> results) {}@Overridepublic void onError(int code, String message) {}});
// File location:TUILiveKit/iOS/TUILiveKit/Sources/Component/LiveInfo/RoomInfoService
public func isFollow(userId: String) {let userInfo = TUIUserInfo()userInfo.userId = userIdV2TIMManager.sharedInstance().checkFollowType([state.ownerId]) { [weak self] checkResultList inguard let self = self, let result = checkResultList?.first else { return }if result.followType == .FOLLOW_TYPE_IN_BOTH_FOLLOWERS_LIST || result.followType == .FOLLOW_TYPE_IN_MY_FOLLOWING_LIST {if !self.state.followingList.contains(where: { $0.userId == userId }) {self.state.followingList.insert(userInfo)}} else {self.state.followingList = state.followingList.filter { $0.userId != userId}}} fail: { code, message indebugPrint("[RoomInfo] isFollow failed, error:\\(code), message:\\(String(describing: message))")}}
// File location:Android/tuilivekit
/src/Main/java/com/trtc/uikit/livekit/service/impl/LiveServiceImpl.javaList<String> userIDList = new ArrayList<>();userIDList.add("userId");V2TIMManager.getFriendshipManager().getUserFollowInfo(userIDList,new V2TIMValueCallback<List<V2TIMFollowInfo>>() {@Overridepublic void onSuccess(List<V2TIMFollowInfo> results) {}@Overridepublic void onError(int code, String message) {}});
// File location:TUILiveKit/iOS/TUILiveKit/Sources/Component/LiveInfo/RoomInfoService
public func getFansNumber() {V2TIMManager.sharedInstance().getUserFollowInfo([state.ownerId]) { [weak self] followInfoList inguard let self = self, let followInfo = followInfoList?.first else { return }self.state.fansNumber = Int(followInfo.followersCount)} fail: { code, message indebugPrint("[RoomInfo] getFansNumber failed, error:\\(code), message:\\(String(describing: message))")}}
Was this page helpful?