This topic describes how to integrate the Push SDK for iOS.
Integrated Environment
Item | Requirement |
OS version | iOS 8.0 or later |
Phone model | iPhone 7 or later |
CPU architecture | ARM64 or ARMv7 |
Integration tool | Xcode 8.0 or later |
bitcode | Disabled |
Download the SDK package
Each release of the Push SDK for iOS is compiled in two versions: an ARM version that supports debugging only on physical devices and an ARM and simulator version that supports debugging on both physical devices and simulators. You must use the ARM version in production environments.
Download the required version of the Push SDK for iOS from SDK download. The Basic Edition of the Push SDK is located in the AlivcLivePusher folder of the decompressed package, as shown in the following figure:
The file content shown in the preceding figure differs in the following ways:
File name | Description |
AlivcLivePusherSDK/arm | The ARM version of the Push SDK Basic Edition. |
AlivcLivePusherSDK/arm&simulator | The ARM and simulator version of the Push SDK Basic Edition. |
Integrate the Push SDK
After you integrate the Push SDK manually or using a pod, you must also request permissions and disable Bitcode.
If you choose to integrate the Push SDK manually, follow the manual integration steps. If you choose to integrate the Push SDK using a pod, follow the pod integration steps.
Manual integration:
Create an SDK test project: App > DemoPush.
Drag the following files into your Xcode project:
AlivcLibReplayKitExt.framework
AlivcLivePusher.framework
To use retouching and sticker effects, also drag the following files:
queen.framework
openvc2.framework
MNN.framework
AliyunQueenUIKit.framework
To depend on a version of the ApsaraVideo Player SDK, also drag the following files:
RtsSDK.framework
AliyunPlayer.framework
artcSource.framework
alivcffmpeg.framework

Select Copy items if needed, and then click Finish.

After you import the SDK, add the SDK dependencies in Xcode > General > Frameworks, Libraries, and Embedded Content.

Pod integration:
In a terminal window, enter the following command to install CocoaPods.
ImportantBefore you install CocoaPods, make sure that a Ruby environment is installed on your Mac.
sudo gem install cocoapodsGo to the project path and enter the following command in a terminal window to create a Podfile file.
pod initEdit the Podfile file to add the Push SDK dependency. If you need live playback, you can also add the ApsaraVideo Player SDK dependency.
# Push SDK Basic Edition pod 'AlivcLivePusher', '~> x.y.z'Notex.y.zrepresents the version number of the Push SDK. Replace this placeholder with the latest version number from the SDK Downloads page, such as 7.4.0.The Push SDK cannot be integrated with the Player SDK (AliyunPlayer). To integrate both the Push SDK and the Player SDK, use the All-in-One Media SDK. For more information, see Scenarios and Integration of the All-in-One Media SDK.
Enter the following command in a terminal window. After the pod command is executed, a project file with the .xcworkspace extension is generated. This file contains the integrated SDK. Double-click the file to update and install the SDK.
pod installor
pod update
Request permissions.
NoteYou must add permissions for camera and microphone access.
In the Info.plist file, add the Privacy - Camera Usage Description and Privacy - Microphone Usage Description permissions for the camera and microphone.
If the app needs to continue stream ingest in the background, enable the background audio capture mode. To do this, select Audio, AirPlay, and Picture in Picture, as shown in the figure.
Disable Bitcode.
The SDK does not support Bitcode. You must disable the Bitcode option in the project. To do this, set Enable Bitcode to NO, as shown in the figure.

Configure the license.
For instructions, see Integrate a license.
Usage notes
For detailed API information, see API reference for the Basic Edition.
For API sample code, see Feature usage.
FAQ
Compilation error
If you receive the Building for iOS, but the linked and embedded framework XXX.framework' was built for iOS + iOS Simulator compilation error, perform the following steps:
Click the Xcode menu.
Choose File > Workspace Settings to open the settings dialog box.
Change Build System to Legacy Build System.
Missing Queen dependency libraries during compilation
If Queen dependency libraries are missing during manual integration, see the Queen_SDK_iOS document to add the required libraries.