All Products
Search
Document Center

ApsaraVideo Live:SDK integration

Last Updated:Mar 05, 2024

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

Note

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. 006

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.互动SDK

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:

  1. Integrate Push SDK for iOS manually

    1. Create an SDK test project and choose App > DemoPush.

    2. 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播放器SDK-新

    3. Select Copy items if needed and click Finish.勾选

    4. After you add the SDK files, choose Xcode > General > Frameworks, Libraries, and Embedded Content to add SDK dependencies.SDK依赖

  2. Integrate Push SDK for iOS in pod mode

    1. Open Terminal and run the following command to install CocoaPods.

      Important

      Set up a Ruby environment on macOS before you install CocoaPods.

      sudo gem install cocoapods
    2. In Terminal, run the following command to create a Podfile file in the project path:

      pod init
    3. 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'
    4. 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
  3. Grant permissions on the microphone and camera.

    Note

    Make 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.后台音频采集

  4. Disable Bitcode.

    You need to set Enable Bitcode to No in the project because the SDK does not support Bitcode.关闭bitcode

  5. 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