Communication Integration - iOS¶
Step 1: Prepare the Environment¶
Be sure that the following development environment requirements are satisfied:
- Apple XCode version 6.0 or higher
- iOS 7.0 or later
- Real iOS devices with audio and video functionality
- Agora Native SDK for iOS: Download either of the latest Voice Package and Full Package(Voice and Video) from downloads .
Step 2: Add the Agora SDK¶
Copy the folder libs from the Agora Native SDK you have downloaded in Step 1: Prepare the Environment to the project folder.
Add the required libraries according to either of the following Step 2 or Step 3.
Use CocoaPods to add the libraries automatically.
Install the CocoaPods by running the following command in the terminal:
brew install cocoapods
For details on how to use the CocoaPods, refer to Cocoapods .
Add the Agora SDK references in the Podfile:
For Voice Package:
For Full Package:
Add the libraries manually.
Select the current Target.
Set the search path of framework in Xcode.
Select File> New> Group in Xcode, and name it, for example, as Frameworks to include all the required frameworks from Agora later.
Click the Frameworks folder you’ve just created, and then go to Building Phases.
Expand the Link Binary with Libraries, and click + to add the following libraries.
Step 3: Access Library¶
In the file viewController.h, add #import <AgoraRtcEngineKit/AgoraRtcEngineKit.h> to enable the use of Agora Native SDK for iOS.
By default, Agora Native SDK uses libc++ (LLVM). Contact firstname.lastname@example.org if you prefer to use libstdc++ (GNU).
The SDK provides FAT Image libraries with multi-architecture support for both 32/64-bit audio simulators and 32/64-bit audio/video real devices.
Create a new bridging file called agora-Bridging-Header.h .
Added the following contents in the bridging file to reference the Agora SDK.
#import <AgoraRtcEngineKit/AgoraRtcEngineKit.h> #import <AgoraRtcCryptoLoader/AgoraRtcCryptoLoader.h>
Set the file as Objective-C Bridging Header:
- Select the current Target.
- Select Building Settings > Swift Compiler-General, and set Objective-C Bridging Header as <targetname>/agora-Bridging-Header.h .