This topic describes how to integrate the Real-Time Communication SDK for iOS.
Prerequisites
The latest version of Xcode is installed. For more information, see Xcode.
You need an Apple developer certificate or a personal account.
Environment requirements
Type |
Description |
Device |
iPhone 5s and later physical devices. |
System version |
iOS 12 and later. |
Integrate using CocoaPods
Make sure that the Ruby environment is installed on your Mac.
platform :ios, '12.0'
target 'DingRTCSample' do
# Integrate the full SDK
pod 'DingRTC_iOS', '3.6.1'
# Selectively integrate base libraries and specified dynamic libraries from the full SDK
pod 'DingRTC_iOS', '3.6.1', :subspecs => ['RtcBasic', 'AudioEnhance', 'FaceBeauty']
end
The pod version number is for reference only. For the latest pod version number, see SDK download.
Starting from version 3.6.1, you can use subspecs to integrate specific dynamic libraries. For information about the supported subspecs modules, see the podspec file for the corresponding version.
Install the SDK.
pod install
After you run the command, an *.xcworkspace file is generated. This indicates that the SDK is successfully integrated.
Follow Steps 5 and 6 of manual integration to complete the project settings.
Integrate manually
Download and decompress the iOS SDK. For the download link, see SDK download.
Create a new project and copy the decompressed SDK files to the project folder.
On the General tab, add the DingRTC.framework or DingRTC.xcframework file and any specific dynamic module libraries from the SDK to your project, and then select Embed & Sign.
The SDK package contains the following folders:
Release-iphoneall folder: Contains files for both physical devices and emulators. You can use either the xcframework or framework format. The xcframework format is recommended.
Release-iphoneos folder: For physical devices.
Release-iphonesimulator folder: For emulators.
On the Build Phases tab, add the following system dependencies.
CoreMedia.framework
AVFoundation.framework
AudioToolbox.framework
VideoToolbox.framework
ReplayKit.framework
On the Signing & Capabilities tab, add the Background Modes capability and enable the background audio permission.
To prevent calls from being interrupted when the application is in the background, you must enable the background audio permission. By default, the SDK continues to push the audio stream when the application is running in the background.
Edit the info.plist file to add camera and microphone permissions.
Connect a device using Xcode and press Command+B. If the interface displays Build Success, the SDK is successfully integrated.
What to do next
After integrating the SDK, you can implement the basic features of Real-Time Communication. For more information, see Implement basic features.