This topic describes how to integrate RTC SDK for iOS.
Prerequisites
- Xcode 9.0 or later is installed. For more information, see Xcode.
- A signed certificate issued by Apple or a personal account is available.
Environment requirements
For more information about environment requirements for iOS, see Limits.
Integrate the SDK in pod mode
Important A Ruby development environment is set up on your device running macOS.
- Open the CLI.
- Install CocoaPods.
sudo gem install cocoapods
- Create a Podfile file.
Go to the directory of your project and run the following command to create the Podfile file:
pop init
- Edit the Podfile file.
platform :ios, '8.0' target 'AliRTCPodTest' do pod 'AliRTCSdk', '1.17.44' endNote The version of the pod that is used in this example is only for reference. For more information about how to obtain the latest version of the pod, see SDK download. - Run the following command to integrate the RTC SDK.
pod install
After you execute the command, a *.xcworkspace file is generated. This indicates that the SDK is integrated.
Integrate the SDK in manual mode
- Download and decompress the package of RTC SDK for iOS. For more information about the download links of the SDK package, see SDK download.
- Create a project and copy the decompressed SDK file to the project.
- On the General tab, add the AliRTCSdk.framework file to the project. Note In RTC SDK for iOS V1.7 or later, AliRTCSdk.framework is a dynamic library, which needs to be loaded to Embedded Binaries.

- On the Build Phases tab, add the following system dependencies:
- libc++.tbd
- CoreMedia.framework
- AVFoundation.framework
- libz.tbd
- libresolv.tbd
- AudioToolbox.framework
- VideoToolbox.framework
- On the Build Settings tab, set Enable Bitcode to No.

- On the Build Settings tab, add -ObjC.

- On the Signing & Capabilities tab, enable the background audio permissions. Note We recommend that you enable the background audio permissions. This way, the SDK can continue to push audio tracks after the application switches to the background of the mobile phone. This ensures that calls are not interrupted.

- Edit the info.plist file to add permissions.

- Connect the device to Xcode. Press Commond+B. If the Build Success message is displayed, the SDK is integrated.
What to do next
After you integrate the RTC SDK, you can use the basic features of RTC. For more information, see iOS.
该文章对您有帮助吗?