This topic describes how to integrate Push SDK for iOS.
Environment requirements
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 version of Push SDK for iOS contains two editions. The edition only for the Arm architecture supports debugging on physical devices. The edition for the Arm architecture and simulators supports debugging on physical devices and simulators. If you want to publish your project online, you must use the edition only for the Arm architecture.
Download the SDK package of the required version from the download link that is provided in SDK download and release notes. The basic edition of Push SDK for iOS is contained in the AlivcLivePusher folder, as shown in the following figure.
The following table describes the contents of the subfolders.
Subfolder | Description |
AlivcLivePusherSDK/arm | The module only for the Arm architecture. |
AlivcLivePusherSDK/arm&simulator | The module for the Arm architecture and simulators. |
The interactive edition of Push SDK for iOS is contained in the AlivcLivePusher_InteractiveSDK folder, as shown in the following figure.
The following table describes the contents of the subfolders.
Subfolder | Description |
AlivcLivePusher_InteractiveSDK/arm | The module only for the Arm architecture. |
AlivcLivePusher_InteractiveSDK/arm&simulator | The module for the Arm architecture and simulators. |
Integrate Push SDK for iOS
After you integrate Push SDK for iOS manually or in pod mode, you need to configure permissions on the microphone and camera, disable Bitcode, and view the usage notes.
Select an integration method and perform the following steps to integrate Push SDK for iOS:
Integrate Push SDK for iOS manually
Create an SDK test project and choose .
Add the following files to the demo project in Xcode:
AlivcLibReplayKitExt.framework
AlivcLivePusher.framework
To use the retouching effects and stickers, you also need to add the following files:
queen.framework
openvc2.framework
MNN.framework
AliyunQueenUIKit.framework
If you use an SDK version that requires ApsaraVideo Player SDK, you also need to add the following files:
RtsSDK.framework
AliyunPlayer.framework
artcSource.framework
alivcffmpeg.framework
Select Copy items if needed and click Finish.
After you add the SDK files, choose to add SDK dependencies.
Integrate Push SDK for iOS in pod mode
Open Terminal and run the following command to install CocoaPods.
ImportantSet up a Ruby environment on macOS before you install CocoaPods.
sudo gem install cocoapods
In Terminal, run the following command to create a Podfile file in the project path:
pod init
Edit the Podfile file to add Push SDK for iOS as a dependency. If you want to use the playback feature, add ApsaraVideo Player SDK as a dependency.
Push SDK for iOS (basic edition):
# Integrate the basic edition of Push SDK for iOS. pod 'AlivcLivePusher', '~> 6.9.0'
Push SDK for iOS (interactive edition):
# Integrate the interactive edition of Push SDK for iOS. pod 'AlivcLivePusher_Interactive', '~> 6.9.0'
In Terminal, run the following command. After the command is run, the project file with the .xcworkspace suffix is generated. Double-click the project file to update or install Push SDK for iOS.
pod install
or
pod update
Grant permissions on the microphone and camera.
NoteMake sure that permissions on your microphone and camera are granted.
Add the following configurations for permissions on the microphone and camera to the Info.plist file: Privacy - Camera Usage Description and Privacy - Microphone Usage Description. If you want your application to continue stream ingest in the background, you need to enable audio recording in the background by selecting Audio, AirPlay, and Picture in Picture, as shown in the following figure.
Disable Bitcode.
You need to set Enable Bitcode to No in the project because the SDK does not support Bitcode.
Configure a license.
In Push SDK for iOS V4.4.2 and later, all-in-one licenses are used. You must configure a license for the SDK. For more information, see Configure a license for iOS.
SDK usage notes
For more information about API operations, see API reference for Push SDK for iOS V6.9.0 (basic edition) or API reference for Push SDK for iOS V6.9.0 (interactive edition), or view the files in the api folder of the SDK package.
For more information about the sample code, see Use Push SDK for iOS.