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.
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:
The following 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:
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).
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:
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.
To see examples for the Agora Video Streaming SDK and Agora UIKit, check the following repository:
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.
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.