Skip to main content
Version: 1.0.x

Agent Starter App - iOS

VideoSDK enables you to seamlessly add a voice-enabled AI agent to your iOS app — this guide walks you through connecting your iOS application to an agent configured and deployed directly from the VideoSDK dashboard.

Prerequisites

  • A deployed AI agent on VideoSDK Agent Cloud. If you haven't done this yet, create and deploy your agent using the Low-Code Deployment UI on the VideoSDK Dashboard — no coding required. Once deployed, note down your Agent ID.
  • For iOS, your development environment must meet the following requirements:
    • iOS 18 or later
    • Xcode 16.4 or later
  • Valid Video SDK Account

Generate Token

To manage secured communication, every participant that connects to a meeting needs an access token. You can easily generate this token by using your apiKey and secret-key, which you can obtain from the VideoSDK Dashboard.

For development purpose, you can generate a temporary token from VideoSDK Dashboard's API section.


tip

The best practice for obtaining a token involves generating it from your backend server which will help in keeping your credentials safe.

Run the Sample Project

Step 1: Clone the sample project

Clone the repository to your local environment.

git clone https://github.com/videosdk-live/agent-starter-app-ios.git
cd agent-starter-ios

Step 2: Open the project in XCode

Open the agent-starter-ios.xcodeproj file using Xcode.

Step 3: Create Your Agent (Optional)

info

If you've already configured and deployed your agent from the VideoSDK Dashboard, you can jump directly to Step 4.

You can create and configure a powerful AI agent directly from the VideoSDK dashboard — no coding required.

Step 1: Create Your Agent

First, follow our detailed guide to Build a Custom Voice AI Agent in Minutes. This will walk you through creating the agent's persona, configuring its pipeline (Realtime or Cascading), and testing it directly from the dashboard.

Step 2: Get Agent and Version ID

Once your agent is created, you need to get its agentId and versionId to connect it to your frontend application.

  1. After creating your agent, go to the agent's page and find the JSON editor on the right side. Copy the agentId.

  2. To get the versionId, click on the 3 dots beside the Deploy button and click on "Version History". Copy the version ID via the copy button of the version you want.

Get agentId and versionId

Step 4: Set up credentials

Before running the app, you need to configure your authentication details. Open agent-starter-ios/Constants/MeetingConfig.swift and supply the required values:

AUTH_TOKEN: <VideoSDK authorization token>
AGENT_ID: <The ID of the Agent of VideoSDK>

MEETING_ID: <VideoSDK Meeting ID | Optional>
VERSION_ID: <VideoSDK Agent's Version ID | Optional>

Tip: You can obtain your AUTH_TOKEN and AGENT_ID from the VideoSDK Dashboard under your Agent Cloud deployment. MEETING_ID is optional — if left blank, the app will create a new meeting automatically. VERSION_ID is also optional, if left blank, the app will fetch the agent's version and choose the latest one and proceed with the meeting.

Step 5: Build and Run

Bingo, Now Select your target physical device and click the Run button (or press Cmd + R) in Xcode!

Once running, the app will use the Dispatch API to send your deployed agent into the meeting room. You'll see the live transcription as you speak, and the agent will respond in real time.


Troubleshooting

Common Issues:

  1. Agent not joining:

    • Check that the AGENT_ID and VERSION_ID in your agent-starter-ios/Constants/MeetingConfig.swift are correctly set.
    • Verify your VideoSDK token is valid and has the necessary permissions.
  2. Audio not working:

    • Check device permissions for microphone access.
  3. "Failed to connect agent" error:

    • Verify your AGENT_ID and VERSION_ID are correct.
    • Check the debug console for any network errors.

Got a Question? Ask us on discord