Build and run the iOS Push SDK demo

更新时间:
复制 MD 格式

Build, run, and test the basic iOS Push SDK demo app.

Download the demo

Download the latest Push SDK demo source code and installation package from SDK download.

Build the demo

Prerequisites

Item

Requirement

OS version

iOS 8.0 or later.

Phone model

iPhone 7 or later.

CPU architecture

ARMv7 and ARM64.

Integration tool

Xcode 8.0 or later.

Bitcode

Disabled.

Run the demo source code

  1. Download and unzip the iOS demo from SDK download.

    The Demo directory structure section describes the project layout.

  2. Open AlivcLivePusherDemo.xcodeproj in Xcode. On the General tab, verify the Display Name (ApsaraVideo Live 4.3.0), Deployment Target (iOS 9.0), supported devices (iPhone and iPad), and device orientation (Portrait, Landscape Left, Landscape Right).

  3. Run the project to launch the demo.

    Demo screenshot 1Demo screenshot 2

Enter a valid RTMP ingest URL in the field marked ① in the figure. After stream ingest starts, use ApsaraVideo Player SDK, FFplay, or VLC to test playback.

Demo directory structure

The demo project contains the AlivcLiveBroadcast, AlivcLivePusherDemo, and AlivcLivePusherDemo.xcodeproj directories. AlivcLivePusherDemo includes AppDelegate.h/m, Controllers, Models, Views, Resources, SDK, and Tools. The SDK directory holds all required framework libraries.

Contents of the SDK directory:

Library file

Description

  • AlivcLivePusher.framework

  • AlivcLibReplayKitExt.framework

Push SDK

  • AliyunQueenUIKit.framework

  • opencv2.framework

  • queen.framework

Queen SDK

  • AliyunPlayer.framework

  • alivcffmpeg.framework

  • artcSource.framework

  • RtsSDK.framework

ApsaraVideo Player SDK

FAQ

Compilation error

If you encounter the Building for iOS, but the linked and embedded framework XXX.framework' was built for iOS + iOS Simulator compilation error, follow these steps:

  1. Click the Xcode menu.

  2. Choose File > Workspace Settings.

  3. Change Build System to Legacy Build System.

How do I get an ingest URL?

Follow the steps in Generate ingest and streaming URLs.

What should I do if the demo fails to ingest a stream?

Use the troubleshooting tool to check if the ingest URL is valid.

How do I get information about active streams?

View and manage active streams on the Active Streams tab of the stream management page.

How do I play a stream?

After stream ingest starts, test playback with ApsaraVideo Player SDK, FFplay, or VLC using a streaming URL from Generate ingest and streaming URLs.

Important

When using RTMP for playback, disconnect the Xcode debugger and run the app directly.