Prerequisites
Before proceeding, ensure that your development environment meets the following requirements:- A Zero Runtime account (create one from the Zero Runtime Dashboard).
- Node.js and a working React Native environment (Android Studio and/or Xcode).
- Python 3.11+ installed on your device.
Project Structure
First, create an empty project usingmkdir folder_name in your preferred location for the React Native frontend. Your final project structure should look like this:
android/: Contains the Android-specific project files.ios/: Contains the iOS-specific project files.App.js: The main React Native component, containing the UI and meeting logic.constants.js: Stores the token and meeting ID for the frontend.index.js: The entry point of the React Native application, where the SDK is registered.agent-react-native.py: The Python AI agent backend using the Google Gemini Live API..env: Environment variables for the Python agent’s API keys.
1. React Native Frontend
Step 1: Create the app and install the SDK
Step 2: Configure the Android project
AndroidManifest.xml file.proguard-rules.pro file (optional, only if you are using Proguard):build.gradle file, update the minimum OS/SDK version to 23:Step 3: Configure the iOS project
sudo gem install cocoapods.react-native-webrtc in your Podfile:react-native-webrtc doesn’t support earlier versions: platform :ios, '12.0'.Install the pods:Info.plist (located at project folder/ios/projectname/info.plist):Step 4: Register the service and configure credentials
index.js file for the initialization service.roomId from the response and create a constants.js file to store your token and meeting ID.Step 5: Build the UI and wire up MeetingProvider
2. Python AI Agent
Step 1: Setup the project
zrt and python-dotenv. Every provider plugin ships with zrt.Step 2: Configure environment variables
.env file in your project root to store your token securely for the Python agent:Step 3: Create the AI agent backend
agent-react-native.py) that joins the same meeting room and interacts with users through voice.3. Run the Application
Step 1: Start the React Native app
Step 2: Run the AI agent
ZERORUNTIME_AUTH_TOKEN from the .env file.Step 3: Connect and interact
-
Join the meeting from the app:
- Tap the Join button in the app.
- Allow microphone permissions when prompted.
-
Agent connection:
- Once you join, the Python agent detects your participation.
- You should see “Participant joined” in the terminal.
- The AI agent greets you and initiates the game.
-
Start playing:
- The agent guides you through a number guessing game (1–100).
- Use your microphone to interact with the AI host.
Troubleshooting
'Waiting for participant...' but no connection
'Waiting for participant...' but no connection
- Ensure both the React Native app and the agent are running.
- Check that the meeting ID matches in
constants.jsandagent-react-native.py. - Verify your Zero Runtime token is valid.
Audio not working
Audio not working
- Check device/simulator permissions for microphone access.
Agent not responding
Agent not responding
- Verify your
ZERORUNTIME_AUTH_TOKENis set in the.envfile and is valid.