Agora with Swift Package Manager Support

One of our aims is for you to integrate all Agora SDKs as easily as possible. Four years ago we first added CocoaPods support to Video Call SDK v1.10.0.

Now, we are happy to make integration even easier with Swift Package Manager support. This post shows you how to find and install the latest Swift packages from Agora in your app.

What is Swift Package Manager?

Swift Package Manager (SwiftPM) is a package dependency manager similar to CocoaPods and Carthage. It’s integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies. SwiftPM is included in Xcode, meaning there is no need to install CocoaPods, run an additional command, or even generate a *.xcworkspace file to continue with your project.

You can find more information about SwiftPM on the official website:

Swift Packages from Agora

The following iOS Swift packages are currently available from Agora:

You can also find them in the Swift Package Index: AgoraRtcEngine_iOS and AgoraUIKit_iOS.

Agora now has some macOS packages available:

Prerequisites

Add a Package Dependency

Adding a package with SwiftPM is incredibly easy. Everything you need is already integrated with Xcode.

To add dependencies, do the following in Xcode:

Xcode will fetch the code for the specified release straight from GitHub, and any attached xcframeworks (of which AgoraRtcEngine_iOS has a few).

Adding Agora’s Swift Package with Xcode

You can now import AgoraRtcKit to your project and create your Agora application!

Check out Apple’s doc showing how to add Swift packages to your project:

Issues

Xcode sometimes has issues downloading large libraries such as the Agora SDK. If any errors are thrown, in Xcode select File > Swift Packages > Reset Package Caches.

If that does not fix your error, open an issue on GitHub with as much detail as possible, and we’ll try to help you.

Testing

To see examples for the Agora Video Streaming SDK and Agora UIKit, check the following repository:

Conclusion

You no longer need to install and run CocoaPods to get Agora up and running in your application. Anyone in your team can open up the Xcode Project file after cloning from your source control system, such as GitHub. The Agora dependency is automatically fetched and included in your working copy.

Other Resources

For more information about building applications using Agora Video and Audio Streaming SDKs, take a look at the Agora Video Call Quickstart Guide and Agora API Reference.

I also invite you to join the Agora Developer Slack community.

--

--

--

Excited about all things Augmented Reality! Developer Evangelist at Agora.io.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Image from Remote URL Using SDWebImageSwiftUI

SwiftUI logo and iPhone displaying an image

Create a SwiftUI Streaming App with Fun Virtual Backgrounds

APM for iOS Apps

Accessibility in iOS

Locking mechanisms in iOS

What is the Equatable Protocol in Swift?

Creating your Shopify Plugin

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store

Max Cobb

Excited about all things Augmented Reality! Developer Evangelist at Agora.io.

More from Medium

[Server-Side Swift] Summarize information/articles for iOS with Vapor

How To Integrate Admob native Ads in iOS CollectionView or TableView Swift

Add Touch ID & Face ID in Swift

SwiftUI View to UIImage