Prerequisites
Before proceeding, ensure that your development environment meets the following requirements:- A Zero Runtime account (create one from the Zero Runtime Dashboard).
- iOS 13.0+, Xcode 13.0+, and Swift 5.0+.
- 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
Your final Xcode project structure should look like this:zrt-agents-quickstart-ios
JoinScreenView.swift
MeetingView.swift
MeetingViewController.swift
RoomsStruct.swift
zrt_agents_quickstart_iosApp.swift
zrt-agents-quickstart-ios.xcodeproj
agent-ios.py
.env
JoinScreenView.swift: Join screen UI.MeetingView.swift: Meeting interface with audio controls.MeetingViewController.swift: Handles meeting logic and events.agent-ios.py: The Python AI agent backend using the Google Gemini Live API..env: Environment variables for the Python agent’s API keys.
1. iOS Frontend
Step 1: Create the app and install the RTC SDK
Create a new iOS app in Xcode:
- Create a new Xcode project.
- Choose the App template.
- Add a Product Name and save the project.
- In Xcode, go to
File > Add Packages... - Enter the repository URL:
https://github.com/videosdk-live/videosdk-rtc-ios-sdk.git - Choose the latest version and click
Add Package.
Info.plist:Info.plist
Step 2: Create models and views
Create the Swift models and views for the meeting interface.
RoomsStruct.swift
JoinScreenView.swift
MeetingView.swift
Step 3: Implement meeting logic
Create the main meeting view controller to handle meeting events.
MeetingViewController.swift
Step 4: Configure the app entry point
Configure the main app entry point.
zrt_agents_quickstart_iosApp.swift
Step 5: Configure environment and credentials
Create a meeting room using the Zero Runtime API:Copy the
roomId from the response and set it as the meetingId in JoinScreenView.swift, and set your token in MeetingViewController.swift (YOUR_ZRT_AUTH_TOKEN).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.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-ios.py) that joins the same meeting room and interacts with users through voice.agent-ios.py
3. Run the Application
Step 1: Run the iOS app
Build and run the app from Xcode on a simulator or physical device.
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
- Run the iOS app on a simulator or device.
- Join the meeting and allow microphone permissions.
- When you join, the Python agent detects your participation and starts speaking.
- Talk to the agent in real time and play the number guessing game.
Troubleshooting
'Waiting for participant...' but no connection
'Waiting for participant...' but no connection
- Ensure the same
room_idis set in both the iOS app (JoinScreenView.swift) and the agent’sRoom(room_id=...). - Verify microphone permissions in iOS Settings > Privacy & Security > Microphone.
- For simulator issues, ensure you’re using a physical device for microphone testing.
Audio not working
Audio not working
- Check that microphone permissions were granted when prompted.
- Ensure your Google API key has Gemini Live API access enabled.
Agent not responding
Agent not responding
- Confirm your Zero Runtime token is valid and the
GOOGLE_API_KEYis set in the.envfile. - 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.