Install WebRTC via Cocoapods
latestAdd the WebRTC-lib pod to your Podfile and run the install command.
pod 'WebRTC-lib'pod installrepository·latest·Indexed 20 days ago
https://github.com/stasel/webrtcA community-driven distribution of precompiled WebRTC framework binaries for iOS, macOS, and macOS Catalyst. Supports integration via Swift Package Manager, Cocoapods, Carthage, or manual installation. Compatible with iOS 12+, macOS 10.11+, and macOS Catalyst 11.0+, with support for arm64 and x86_64 architectures and encodings including VP9, H264, and H265 (HEVC).
Add the WebRTC-lib pod to your Podfile and run the install command.
pod 'WebRTC-lib'pod installCartfile using the JSON endpoint.--use-xcframeworks flag..xcframework located at ./Carthage/Build/WebRTC.xcframework to your target's embedded frameworks.binary "https://raw.githubusercontent.com/stasel/WebRTC/latest/WebRTC.json"carthage update --use-xcframeworks.xcframework to your target's embedded frameworks in Xcode.You can add WebRTC to your Xcode project using the built-in Swift Package Manager interface (File > Swift Packages > Add Package Dependency) or by modifying your Package.swift file.
To use a specific version, use .upToNextMajor("150.0.0"). To always use the most up-to-date binaries, point to the latest branch.
// Using a specific version
dependencies: [
.package(url: "https://github.com/stasel/WebRTC.git", .upToNextMajor("150.0.0"))
]
// Using the latest branch for up-to-date binaries
dependencies: [
.package(url: "https://github.com/stasel/WebRTC.git", branch: "latest")
]To use the WebRTC library in your Swift code, import the module:
import WebRTCFor a complete implementation example, refer to the WebRTC-iOS demo app.
| Platform / arch | arm64 | x86_64 |
|---|---|---|
| iOS (device) | ✅ | N/A |
| iOS (simulator) | ✅ | ✅ |
| macOS | ✅ | ✅ |
| macOS Catalyst | ✅ | ✅ |