• 製品
  • 価格
  • リソース
  • サポート
このページは現在英語版のみで提供されており、日本語版も近日中に提供される予定です。ご利用いただきありがとうございます。

TUILiveGiftManager

Copyright (c) 2025 Tencent. All rights reserved.
Module: TUILiveGiftManager @ TUIKitEngine
Function: APIs for live stream gifts.

TUILiveGiftManager

TUILiveGiftManager

Function List
Description
Gift quantity change callback
Gift message callback
Like message callback
add event callback
remove event callback
gift list
sendGift
send a gift
sendLike
Send a like
Number of gifts obtained by the room owner
Number of likes obtained

Struct Type

Function List
Description
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) {};
Parameter
Description
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) {};
Parameter
Description
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) {};
Parameter
Description
roomId
liveRoomId
totalLikesReceived
Number of likes
sender
Like sender information

addObserver

add event callback
void addObserver(TUILiveGiftObserver observer);
Parameter
Description
observer
instance of listen

removeObserver

remove event callback
void removeObserver(TUILiveGiftObserver observer);
Parameter
Description
observer
instance of listen

getGiftList

gift list
Future<TUIValueCallBack<List<TUIGiftCategory>>> getGiftList(String roomId);
Parameter
Description
roomId
liveRoomId

sendGift

send a gift
Future<TUIActionCallback> sendGift(String roomId,
String giftId,
int count);
Parameter
Description
roomId
liveRoomId
giftId
gift ID
count
Number of gifts

sendLike

Send a like
Future<TUIActionCallback> sendLike(String roomId,
int count);
Parameter
Description
roomId
liveRoomId
count
Number of likes

getGiftCountByAnchor

Number of gifts obtained by the room owner
Future<TUIValueCallBack<TUIGiftCountRequestResult>> getGiftCountByAnchor(String roomId);
Parameter
Description
roomId
liveRoomId

getLikesCount

Number of likes obtained
Future<TUIValueCallBack<int>> getLikesCount(String roomId);
Parameter
Description
roomId
liveRoomId

TUIGiftInfo

gift information
Enumeration Types
Description
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
Enumeration Types
Description
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
Enumeration Types
Description
totalGiftsSent
Number of gifts
totalGiftCoins
Gift value
totalUniqueGiftSenders
Number of gift senders