English | 中文
This repository contains sample projects using the Agora RTC Objective-C SDK for iOS.
The project uses a single app to combine a variety of functionalities. Each function is loaded as a storyboard for you to play with.
Function | Location |
---|---|
Live streaming | LiveStreaming.swift |
Custom audio capture | CustomAudioSource.swift |
Custom video renderer | CustomVideoRender.swift |
Raw audio and video frames (Objective-C with C++, uses AgoraMediaRawData.h ) |
RawMediaData.swift |
Raw audio frames (Native Objective-C interface) | RawAudioData.swift |
Custom video capture (Push) | CustomVideoSourcePush.swift |
Custom video capture (mediaIO) | CustomVideoSourceMediaIO.swift |
Switch a channel | QuickSwitchChannel.swift |
Join multiple channels | JoinMultiChannel.swift |
Join an audio channel | JoinChannelAudio.swift |
Join a video channel | JoinChannelVideo.swift |
Play audio files and audio mixing | AudioMixing.swift |
Voice effects | VoiceChanger.swift |
MediaPlayer Kit | MediaPlayer.swift |
RTMP streaming | RTMPStreaming.swift |
Audio/video stream SDK/custom encryption | StreamEncryption.swift |
Video metadata | VideoMetadata.swift |
Group video chat | VideoChat.swift |
Pre-call test | PrecallTest.swift |
Channel media relay | MediaChannelRelay.swift |
Super resolution | SuperResolution.swift |
Use multi-processing to send video streams from screen sharing and local camera | ScreenShare.swift |
Use custom video source (mediaIO) to implement AR function | ARKit.swift |
Send data stream | CreateDataStream.swift |
Geofencing | GlobalSettings.swift |
- Xcode 10.0+
- Physical iOS device (iPhone or iPad)
- iOS simulator is NOT supported
-
Navigate to the iOS folder and run following command to install project dependencies:
$ pod install
-
Open the generated
APIExample.xcworkspace
file with Xcode. -
Edit the
KeyCenter.swift
file.- Replace
YOUR APP ID
with your App ID. - Replace
YOUR ACCESS TOKEN
with the Access Token.
struct KeyCenter { static let AppId: String = <#Your App Id#> // assign token to nil if you have not enabled app certificate static var Token: String? = <#Temp Access Token#> }
See Set up Authentication to learn how to get an App ID and access token. You can get a temporary access token to quickly try out this sample project.
The Channel name you used to generate the token must be the same as the channel name you use to join a channel.
To ensure communication security, Agora uses access tokens (dynamic keys) to authenticate users joining a channel.
Temporary access tokens are for demonstration and testing purposes only and remain valid for 24 hours. In a production environment, you need to deploy your own server for generating access tokens. See Generate a Token for details.
- Replace
-
Build and run the project in your iOS device.
You are all set! Feel free to play with this sample project and explore features of the Agora RTC SDK.
If you have any problems or suggestions regarding the sample projects, feel free to file an issue.
- Check our FAQ to see if your issue has been recorded.
- Dive into Agora SDK Samples to see more tutorials
- Take a look at Agora Use Case for more complicated real use case
- Repositories managed by developer communities can be found at Agora Community
- If you encounter problems during integration, feel free to ask questions in Stack Overflow
After users upgrade their iOS devices to iOS 14.0, and use an app that integrates the Agora RTC SDK for iOS with the version earlier than v3.1.2 for the first time, users see a prompt for finding local network devices. The following picture shows the pop-up prompt:
Refer to the this FAQ to learn how to fix this issue.
The sample projects are under the MIT license.