Copyright (c) 2025 Tencent. All rights reserved.
Module: TUILiveGiftManager @ TUIKitEngine
Function: APIs for live stream gifts.
TUILiveGiftManager
|
| Gift quantity change callback |
| Gift message callback |
| Like message callback |
| add event callback |
| remove event callback |
| gift list |
| send a gift |
| Send a like |
| Number of gifts obtained by the room owner |
| Number of likes obtained |
Struct Type
|
| gift information |
| gift classification information |
| Number of gifts Request result |
OnGiftCountChanged
Gift quantity change callback
OnGiftCountChanged onGiftCountChanged = (String roomId,
int totalGiftsSent,
int totalGiftCoins,
int totalUniqueGiftSenders) {};
|
roomId | liveRoomId |
totalGiftsSent | Number of gifts |
totalGiftCoins | Gift value |
totalUniqueGiftSenders | Number of gift senders |
OnReceiveGiftMessage
Gift message callback
OnReceiveGiftMessage onReceiveGiftMessage = (String roomId,
TUIGiftInfo giftInfo,
int count,
TUIUserInfo sender) {};
|
roomId | liveRoomId |
giftInfo | gift information |
count | Number of gifts |
sender | Gift sender information |
OnReceiveLikesMessage
Like message callback
OnReceiveLikesMessage onReceiveLikesMessage = (String roomId,
int totalLikesReceived,
TUIUserInfo sender) {};
|
roomId | liveRoomId |
totalLikesReceived | Number of likes |
sender | Like sender information |
addObserver
add event callback
void addObserver(TUILiveGiftObserver observer);
|
observer | instance of listen |
removeObserver
remove event callback
void removeObserver(TUILiveGiftObserver observer);
|
observer | instance of listen |
getGiftList
gift list
Future<TUIValueCallBack<List<TUIGiftCategory>>> getGiftList(String roomId);
sendGift
send a gift
Future<TUIActionCallback> sendGift(String roomId,
String giftId,
int count);
|
roomId | liveRoomId |
giftId | gift ID |
count | Number of gifts |
sendLike
Send a like
Future<TUIActionCallback> sendLike(String roomId,
int count);
|
roomId | liveRoomId |
count | Number of likes |
getGiftCountByAnchor
Number of gifts obtained by the room owner
Future<TUIValueCallBack<TUIGiftCountRequestResult>> getGiftCountByAnchor(String roomId);
getLikesCount
Number of likes obtained
Future<TUIValueCallBack<int>> getLikesCount(String roomId);
TUIGiftInfo
gift information
|
giftId | Gift ID |
name | Gift name |
desc | Gift description |
iconUrl | Gift icon URL |
resourceUrl | Gift resource URL |
level | Gift level |
coins | Gift price |
extensionInfo | Gift custom information |
TUIGiftCategory
gift classification information
|
categoryId | Gift category ID |
name | Gift category name |
desc | Gift category description |
extensionInfo | Gift custom information |
giftList | Gift category gift list |
TUIGiftCountRequestResult
Number of gifts Request result
|
totalGiftsSent | Number of gifts |
totalGiftCoins | Gift value |
totalUniqueGiftSenders | Number of gift senders |