Skip to main content
Zero Runtime lets you integrate an AI voice agent into your React Native app (Android/iOS) within minutes. The agent joins the same meeting room and interacts over voice using the Google Gemini Live API.

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.
  • A Google API key with Gemini Live API access.
You need a Zero Runtime account to generate a token and a Google API key for the Gemini Live API. Generate a token from the Zero Runtime Dashboard and a Google API key from Google AI Studio.

Project Structure

First, create an empty project using mkdir folder_name in your preferred location for the React Native frontend. Your final project structure should look like this:
root
android
ios
App.js
constants.js
index.js
agent-react-native.py
.env
You will be working on the following files:
  • 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

Create a React Native app and install the React Native SDK:

Step 2: Configure the Android project

Add the required permissions in the AndroidManifest.xml file.
android/app/src/main/AndroidManifest.xml
Link the necessary native dependencies:
android/app/build.gradle
android/settings.gradle
MainApplication.kt
android/gradle.properties
Include the following line in your proguard-rules.pro file (optional, only if you are using Proguard):
android/app/proguard-rules.pro
In your build.gradle file, update the minimum OS/SDK version to 23:
android/build.gradle

Step 3: Configure the iOS project

Ensure that you are using CocoaPods version 1.10 or later. To update CocoaPods, reinstall the gem using sudo gem install cocoapods.
Change the path of react-native-webrtc in your Podfile:
ios/Podfile
Update the platform field in the Podfile to iOS 12.0 or above, since react-native-webrtc doesn’t support earlier versions: platform :ios, '12.0'.Install the pods:
Declare the camera and microphone permissions in Info.plist (located at project folder/ios/projectname/info.plist):
ios/MyApp/Info.plist

Step 4: Register the service and configure credentials

Register the SDK services in your root index.js file for the initialization service.
index.js
Create a meeting room using the Zero Runtime API:
Copy the roomId from the response and create a constants.js file to store your token and meeting ID.
constants.js

Step 5: Build the UI and wire up MeetingProvider

App.js

2. Python AI Agent

Step 1: Setup the project

Use Python 3.11 or higher, then install the Zero Runtime Agents SDK. Create and activate a virtual environment, then install zrt and python-dotenv. Every provider plugin ships with zrt.
New to uv? See the uv install guide.

Step 2: Configure environment variables

Create a .env file in your project root to store your keys and token securely for the Python agent:
.env

Step 3: Create the AI agent backend

Create the Python AI agent (agent-react-native.py) that joins the same meeting room and interacts with users through voice.
agent-react-native.py

3. Run the Application

Step 1: Start the React Native app

Step 2: Run the AI agent

Open a new terminal, activate your virtual environment, and run the Python agent. It reads GOOGLE_API_KEY from the .env file.

Step 3: Connect and interact

  1. Join the meeting from the app:
    • Tap the Join button in the app.
    • Allow microphone permissions when prompted.
  2. 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.
  3. Start playing:
    • The agent guides you through a number guessing game (1–100).
    • Use your microphone to interact with the AI host.

Troubleshooting

  • Ensure both the React Native app and the agent are running.
  • Check that the meeting ID matches in constants.js and agent-react-native.py.
  • Verify your Zero Runtime token is valid.
  • Check device/simulator permissions for microphone access.
  • Ensure your Google API key has Gemini Live API access enabled.
  • Verify your GOOGLE_API_KEY is set in the .env file.
  • Check that the Gemini Live API is enabled in your Google Cloud Console.

Next Steps

Quickstart Example

Complete working example with source code.

Build Your First Voice Agent

Learn the Cascade and Realtime pipelines in depth.