tencent cloud

Tencent Real-Time Communication

Release Notes and Announcements
Release Notes
Recent Product Announcement
TRTC Live (TUILiveKit) Product Launch Announcement
TRTC Conference Official Editions Launched
The commercial version of Conference is coming soon
Terms and Conditions Applicable to $9.9 Starter Package
Rules for the "First Subscription $100 Discount" Promotion
Announcement on the Start of Beta Testing for Multi-person Audio and Video Conference
TRTC Call Official Editions Launched
License Required for Video Playback in New Version of LiteAV SDK
TRTC to Offer Monthly Packages
Product Introduction
Overview
Concepts
Features
Strengths
Use Cases
Performance Statistics
Tencent RTC Quickplay: Experience Ultimate Real-Time Audio and Video Interaction!
Purchase Guide
Billing Overview
Free Minutes
Monthly subscription
Pay-as-you-go
TRTC Overdue and Suspension Policy
FAQs
Refund Instructions
User Tutorial
Free Demo
Call
Overview
Activate the Service
Run Demo
Integration
Offline Call Push
Conversational Chat
On-Cloud Recording
AI Noise Reduction
UI Customization
Calls integration to Chat
Additional Features
No UI Integration
Server APIs
Client APIs
Solution
ErrorCode
Release Notes
FAQs
Conference
Overview(TUIRoomKit)
Activate the Service (TUIRoomKit)
Run Demo(TUIRoomKit)
Integration(TUIRoomKit)
Screen Sharing (TUIRoomKit)
Schedule a meeting (TUIRoomKit)
In-meeting Call (TUIRoomKit)
UI Customization(TUIRoomKit)
Virtual Background (TUIRoomKit)
Conference Control (TUIRoomKit)
Cloud Recording (TUIRoomKit)
AI Noise Reduction (TUIRoomKit)
In-Conference Chat (TUIRoomKit)
Robot Streaming (TUIRoomKit)
Enhanced Features (TUIRoomKit)
Client APIs (TUIRoomKit)
Server APIs (TUIRoomKit)
FAQs (TUIRoomKit)
Error Code (TUIRoomKit)
SDK Update Log (TUIRoomKit)
Live
Billing of Video Live Component
Overview
Activating the Service (TUILiveKit)
Run Demo
No UI Integration
UI Customization
Live Broadcast Monitoring
Video Live Streaming
Voice Chat Room
Advanced Features
Client APIs
Server APIs
Error Codes
Release Notes
FAQs
RTC Engine
Activate Service
SDK Download
API Examples
Usage Guidelines
API Reference Manual
Advanced Features
AI Integration
Overview
Configure MCP Server
Install Skills
Integration Guide
FAQ
RTC RESTFUL API
History
Introduction
API Category
Room Management APIs
Stream mixing and relay APIs
On-cloud recording APIs
Data Monitoring APIs
Pull stream Relay Related interface
Web Record APIs
AI Service APIs
Cloud Slicing APIs
Cloud Moderation APIs
Making API Requests
Call Quality Monitoring APIs
Usage Statistics APIs
Data Types
Appendix
Error Codes
Console Guide
Application Management
Package Management
Usage Statistics
Monitoring Dashboard
Development Assistance
Solution
Real-Time Chorus
FAQs
Migration Guide
Billing
Features
UserSig
Firewall Restrictions
How to Downsize Installation Package
Android and iOS
Web
Flutter
Electron
TRTCCalling for Web
Audio and Video Quality
Others
Legacy Documentation
RTC RoomEngine SDK(Old)
Integrating TUIRoom (Web)
Integrating TUIRoom (Android)
Integrating TUIRoom (iOS)
Integrating TUIRoom (Flutter)
Integrating TUIRoom (Electron)
TUIRoom APIs
On-Cloud Recording and Playback (Old)
RTC Analytics Monthly Packages (Previous Version)
Protocols and Policies
Compliance
Security White Paper
Notes on Information Security
Service Level Agreement
Apple Privacy Policy: PrivacyInfo.xcprivacy
TRTC Policy
Privacy Policy
Data Processing And Security Agreement
Glossary

Live Gift Component (iOS UIKit)

PDF
Focus Mode
Font Size
Last updated: 2025-12-25 10:20:19
This guide introduces how to quickly integrate the TUILiveKit live gifting component into your project.

Component Overview

The gifting feature in TUILiveKit consists of two main UI components:
Component Name
Class Name
Description
Gift Selection Panel
GiftListView
Shows the available gifts and handles user selection and sending actions.
Gift Animation Display
GiftPlayView
Receives gift messages and renders animations (e.g., SVGA) on screen.

Demo Effects

Gift Panel
Live Comment Gifts
Full-Screen Gifts










Quick Start

Step 1. Activate the Service

Follow the Activate the Service guide to enable TUILiveKit.
Note:
To use the gifting system, activate either the Free Trial, or Pro edition. The number of configurable gifts depends on the selected package. For details, see the Gift System section in Feature and Billing Description and choose the package that fits your needs.

Step 2: Configure Your Project

Project Configuration:
Video Live Streaming: Follow Video Live Streaming - Preparation to complete TUILiveKit integration.
Voice Chat Room: Follow Voice Chat Room - Preparation to complete TUILiveKit integration.
Version Requirement: TUILiveKit >= 3.2.0.

Step 3. Add Gift List Display Page

Add the gift list display page to your app so the audience can browse available gifts. Use the sample code below to create the GiftListView component and add it to your view:
import TUILiveKit

class YourGiftViewController: UIViewController {
// 1. Create GiftListView object
// - roomId: Should match the roomId of the live stream the audience has joined
lazy var giftListView = {
let view = GiftListView(roomId: liveId)
return view
}()

private let liveId: String
// ... additional code ...

public override func viewDidLoad() {
super.viewDidLoad()
// 2. Add the component to your view and set up the layout
view.addSubView(giftListView)
giftPlayView.snp.remakeConstraints { make in
make.leading.trailing.equalToSuperview()
make.height.equalTo(256)
make.bottom.equalToSuperview()
}
}
}

Step 4. Add Gift Animation Playback Page

Add the gift animation playback page to your app. The GiftPlayView component automatically receives gift messages and plays the corresponding animations. Use the sample code below to create the GiftPlayView component and add it to your view:
import TUILiveKit
// YourAnchorViewController represents your host view controller. Audience side can refer to the following example:
class YourAnchorViewController: UIViewController {
// 1. Create and initialize GiftPlayView object
// - roomId: Should match the roomId of the live stream the audience has joined
lazy var giftPlayView = {
let view = GiftPlayView(roomId: liveId)
return view
}()

private let liveId: String
// ... other code ...

public override func viewDidLoad() {
super.viewDidLoad()
// 2. Add the component to your view and set up the layout
view.addSubView(giftPlayView)
giftPlayView.snp.remakeConstraints { make in
make.edges.equalToSuperview()
}
}
}

Next Steps

After completing the UI integration, your app will support basic gifting functionality. To build a production-ready gifting system, refer to the Backend Integration and Advanced Features guide to implement the following:
Custom Gift Configuration: Upload custom gift icons, animations, and pricing via Server APIs.
Payment Integration: Configure callback URLs to handle balance verification and payment processing through your billing backend.
PK Score Sync: Convert gift values to PK scores in real-time during host battles.
Analytics: Access gift transaction records, revenue metrics, and other operational data.
Upgrade Gift Effect SDK: If SVGA does not meet your needs, you can integrate advanced animation players to support MP4, PAG, or other high-quality transparent animation formats.


Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback