Skip to content

livekit-examples/swift-example

Repository files navigation

LiveKit SDK Example App for iOS & macOS

This app demonstrates the basic usage of LiveKit Swift SDK (iOS/macOS). See LiveKit Docs for more information.

macOS macOS

How to run the example

Get the code

  1. Clone this LiveKit Swift Example repo.
  2. Open LiveKitExample.xcodeproj (not the -dev.xcworkspace).
  3. Wait for packages to sync.

Change bundle id & code signing information

  1. Select the LiveKitExample project from the left Navigator.
  2. For each Target, select Signing & Capabilities tab and update your Team and Bundle Identifier to your preference.

🚀 Run

  1. Select LiveKitExample (iOS) or LiveKitExample (macOS) from the Scheme selector at the top of Xcode.
  2. Run the project from the menu ProductRun or by ⌘R.

If you encounter code signing issues, make sure you change the Team and bundle id from the previous step.

⚡️ Connect

  1. Prepare & Start LiveKit Server. See the Getting Started page for more information.
  2. Generate an access token.
  3. Enter the Server URL and Access token to the example app and tap Connect.

Server URL would typically look like ws://localhost:7880 depending on your configuration. It should start with ws:// for non-secure and wss:// for secure connections.

Troubleshooting

Package errors

If you get package syncing errors, try resetting your package caches by right clicking Package Dependencies and choosing Reset Package Caches from the Navigator.

Getting help / Contributing

Please join us on Slack to get help from our devs / community members. We welcome your contributions(PRs) and details can be discussed there.

Development

For development, open LiveKitExample-dev.xcworkspace instead. This workspace will compile with the local ../client-sdk-ios.