A React Native application built with Expo for real-time video streaming with avatar capabilities using Agora SDK.
Before setting up the project, ensure you have the following installed:
-
Node.js (v18 or later)
- Download from nodejs.org
- Verify installation:
node --version
-
npm (Package Manager)
- Built in with Node
-
Expo CLI
- Install globally:
npm install -g @expo/cli - Verify installation:
npx expo --version
- Install globally:
-
Android Studio
- Download from developer.android.com
- Install Android SDK (API level 34 or latest)
- Configure Android SDK path in your environment variables
- Enable Developer Options and USB Debugging on your Android device
-
Java Development Kit (JDK)
- JDK 17 or later
- Set
JAVA_HOMEenvironment variable
-
Xcode (latest version)
- Download from Mac App Store
- Install iOS Simulator
- Install Xcode Command Line Tools:
xcode-select --install
-
CocoaPods
- Install:
sudo gem install cocoapods - Verify installation:
pod --version
- Install:
- Git for version control
- VS Code (recommended) with React Native extensions
- Physical device or emulator for testing
# Clone the repository
git clone <repository-url>
cd akool-native
# Install dependencies using pnpm
npm install
# For iOS, install CocoaPods dependencies
cd ios && pod install && cd ..Create a .env file in the root directory with the following configuration:
# Create .env file
touch .envAdd the following environment variables to your .env file:
# Akool API Configuration
EXPO_PUBLIC_AKOOL_API_BASE_URL=https://openapi.akool.com/api/open/v4
EXPO_PUBLIC_AKOOL_API_TOKEN="your-token"
# Avatar Configuration
EXPO_PUBLIC_AVATAR_ID=dvp_Tristan_cloth2_1080P
# Voice Configuration
EXPO_PUBLIC_VOICE_ID=Xb7hH8MSUJpSbSDYk0k2
# Language and Mode Configuration
EXPO_PUBLIC_LANGUAGE=en
EXPO_PUBLIC_MODE_TYPE=1
# Session Configuration
EXPO_PUBLIC_SESSION_DURATION=2Important: Replace "your-token" with your actual Akool API token.
# Start the Expo development server
npm start
# or
npx expo start# Run on Android emulator/device
npm run android
# or
npx expo run:android# Run on iOS simulator/device
npm run ios
# or
npx expo run:ios# Run web version
npm run web
# or
npx expo start --web| Command | Description |
|---|---|
npm start |
Start the Expo development server |
npm run android |
Run on Android emulator/device |
npm run ios |
Run on iOS simulator/device |
npm run web |
Run web version |
npm run lint |
Run ESLint for code quality |
npm run reset-project |
Reset project to clean state |
# Clear Expo cache
npx expo start --clear
# Clear npm cache
npm cache clean --force
# Reset Metro bundler cache
npx expo start --reset-cache# List connected Android devices
adb devices
# View Android logs
adb logcat
# Clear app data on device
adb shell pm clear com.anonymous.akoolnative
# Force stop the app
adb shell am force-stop com.anonymous.akoolnative
# Install APK manually
adb install ./android/app/build/outputs/apk/debug/app-debug.apk# List iOS simulators
xcrun simctl list devices
# Reset iOS simulator
xcrun simctl erase all
# View iOS logs
xcrun simctl spawn booted log stream --predicate 'subsystem contains "com.anonymous.akoolnative"'# Clean and rebuild for Android
cd android && ./gradlew clean && cd ..
# Clean and rebuild for iOS
cd ios && rm -rf build && xcodebuild clean && cd ..
# Reinstall node modules
rm -rf node_modules && npm install
# Reinstall iOS pods
cd ios && rm -rf Pods Podfile.lock && pod install && cd ..# Check network connectivity
npx expo diagnostics
# Test on physical device with same network
npx expo start --tunnel
# Check camera/microphone permissions
# Android: Settings > Apps > Akool Native > Permissions
# iOS: Settings > Privacy & Security > Camera/Microphone- Real-time Video Streaming: Powered by Agora SDK
- Cross-platform: Runs on iOS, Android, and Web
- Modern Navigation: Uses Expo Router for file-based routing
- TypeScript: Full TypeScript support for better development experience
- Native Performance: Utilizes React Native's new architecture
akool-native/
βββ app/ # App screens (Expo Router)
βββ components/ # Reusable UI components
βββ constants/ # App constants and configurations
βββ contexts/ # React contexts (AgoraContext, etc.)
βββ hooks/ # Custom React hooks
βββ assets/ # Images, fonts, and other assets
βββ android/ # Android native code
βββ ios/ # iOS native code
βββ scripts/ # Build and utility scripts
- Metro bundler issues: Clear cache with
npx expo start --clear - Android build fails: Check Android SDK path and Java version
- iOS build fails: Ensure Xcode and CocoaPods are up to date
- Permission errors: Check camera/microphone permissions on device
- Network issues: Use
--tunnelflag for testing on physical devices
- Use physical devices for testing real streaming performance
- Monitor memory usage during video streaming sessions
- Test on various device specifications and network conditions
- Fork the repository
- Create a feature branch:
git checkout -b feature/new-feature - Commit changes:
git commit -am 'Add new feature' - Push to branch:
git push origin feature/new-feature - Submit a Pull Request
This project is private and proprietary.