All Products
Search
Document Center

ApsaraVideo Live:SDK integration

Last Updated:Nov 04, 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 release of 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 physical devices and simulators. You must use the ARM version in production environments.

Download the SDK package from the link provided in SDK download and release notes. The basic edition of Push SDK for iOS is stored in the AlivcLivePusher folder, as shown in the following figure.006

The following table describes the subfolders.

Subfolder

Description

AlivcLivePusherSDK/arm

The ARM version of the basic edition of Push SDK for iOS.

AlivcLivePusherSDK/arm&simulator

The ARM and simulator version of the basic edition of Push SDK for iOS.

The interactive edition of Push SDK for iOS is stored in the AlivcLivePusher_InteractiveSDK folder, as shown in the following figure.互动SDK

The following table describes the subfolders.

Subfolder

Description

AlivcLivePusher_InteractiveSDK/arm

The ARM version of the interactive edition of Push SDK for iOS.

AlivcLivePusher_InteractiveSDK/arm&simulator

The ARM and simulator version of the interactive edition of Push SDK for iOS.

Integrate Push SDK for iOS

You can integrate Push SDK for iOS manually or by using CocoaPods. After integration, you must configure microphone and camera permissions, disable Bitcode, and view the SDK usage notes.

Select an integration method and perform the corresponding steps to integrate Push SDK for iOS.

  1. Manually integrate Push SDK for iOS

    1. Create an Xcode project for your application. In this example, a project named DemoPush is created.

    2. Add the following files to the project:

      • AlivcLibReplayKitExt.framework

      • AlivcLivePusher.framework

      If your application requires retouching effects and stickers, drag the following files to Xcode:

      • queen.framework

      • openvc2.framework

      • MNN.framework

      • AliyunQueenUIKit.framework

      If you want to integrate ApsaraVideo Player SDK for stream playback, drag the following files to Xcode:

      • 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 the SDK by using CocoaPods

    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.17.0'

      Push SDK for iOS (interactive edition):

      # Integrate the interactive edition of Push SDK for iOS.
      pod 'AlivcLivePusher_Interactive', '~> 6.17.0'
    4. Run the following command in Terminal. After you run the command, a project file whose name contains the .xcworkspace suffix is generated. Double-click the file to update or install Push SDK for iOS.

      pod install

      or

      pod update
  3. Configure the required permissions

    Note

    You must configure camera and microphone permissions.

    Select the Info.plist file in the left-side project navigator. In the editor area that appears, add the Privacy - Camera Usage Description and Privacy - Microphone Usage Description keys and specify values for the keys. 摄像头和麦克风权限If your application needs to continue stream ingest in the background, select Audio, AirPlay, and Picture in Picture in the Background Modes section, as shown in the following figure.后台音频采集

  4. Disable Bitcode

    The SDK does not support Bitcode. You must set Enable Bitcode to No, as shown in the following figure.关闭bitcode

  5. Configure a license

    Push SDK 4.4.2 and later versions support all-in-one licenses. You must configure a license for the SDK. For more information, see Configure a license for iOS.

SDK usage notes