
react-native-safe-area-context. If not, install it with:yarn add react-native-safe-area-context
react-native-tuikit-live package provides a complete UI and business logic for host-side live streaming. To integrate the host page:AnchorPage component.AnchorPage component will automatically create a live streaming room, you only need to input the following callback parameters:onBack: Triggered when returning to the previous page.onEndLive: Triggered when the live stream ends.useState. For production apps, it is recommended to use navigation libraries like React Navigation for page management. To understand how to integrate navigation libraries, refer to React Navigation official documentation./**Simple navigation example - use useState to manage page transitions*/import React, { useState } from 'react';import { AnchorPage } from 'react-native-tuikit-live';import { View, Button, StyleSheet } from 'react-native';import { SafeAreaProvider } from 'react-native-safe-area-context';type PageType = 'home' | 'anchor' | 'liveEnd';function MyApp() {const [currentPage, setCurrentPage] = useState<PageType>('home');const [endedLiveID, setEndedLiveID] = useState<string>('');// start live streamingconst handleStartLive = () => {setCurrentPage('anchor');};// Return from anchor pageconst handleBackFromAnchor = () => {setCurrentPage('home');};// live streaming endconst handleEndLive = (liveID?: string) => {setEndedLiveID(liveID || '');setCurrentPage('liveEnd');};return (<SafeAreaProvider>{currentPage === 'home' && (<View style={styles.container}><Button title="Start live streaming" onPress={handleStartLive} /></View>)}{currentPage === 'anchor' && (<AnchorPageonBack={handleBackFromAnchor}onEndLive={handleEndLive}/>)}{currentPage === 'liveEnd' && (<View style={styles.container}><Button title="Back to homepage" onPress={() => setCurrentPage('home')} /></View>)}</SafeAreaProvider>);}const styles = StyleSheet.create({container: {flex: 1,justifyContent: 'center',alignItems: 'center',},});export default MyApp;
tuikit-atomic-x/src/static/images directory. The table below lists some examples. You can replace these icons as needed.Icon Path | Description |
/static/images/link-host.png | “Co-host” icon in the bottom action bar |
/static/images/link-guest.png | “Guest” icon in the bottom action bar |
/static/images/live-more.png | “More” icon in the bottom action bar |
/static/images/live-end.png | “End Live” icon in the top action bar |
tuikit-atomic-x/src/locales/ directory.
live/src/pages/Anchor/index.tsx directly.// Other code<View>.......{/* Bottom operation bar */}<TouchableOpacitystyle={styles.actionButtonItem}onPress={() => showCoGuestPanel('requests')}activeOpacity={0.7}>{/* Replace the image address with your resources */}<Imagesource={require('/static/images/link-guest.png')}style={styles.actionButtonIcon}resizeMode="contain"/><Text style={styles.actionButtonText}>{product}</Text></TouchableOpacity></View>

{/* <TouchableOpacitystyle={styles.actionButtonItem}onPress={showCoHostPanel}activeOpacity={0.7}><Imagesource={require('react-native-tuikit-atomic-x/src/static/images/link-host.png')}style={styles.actionButtonIcon}resizeMode="contain"/><Text style={styles.actionButtonText}>{t('anchor.linkHost')}</Text></TouchableOpacity> */}
Feature | Description | Integration Guide |
Audience Viewing | Lets audience join the host’s live room and watch the stream, including guest connections, live room info, online audience, and live comments display | |
Live Stream List | Shows the Live Stream List interface and features, including live stream list and room info display |
Feedback