Live Broadcast Quickstart - iOS

Step 1: Obtain the SDK

Download the latest SDK from downloads or contact sales-us@agora.io.

Agora Native SDK for iOS has two packages:

Package Structure
Voice Package

The package structure is listed as follows:

./libs: including the required libraries

./samples: including the sample codes

  • Communication: Agora-iOS-Voice-Tutorial-Swift-1to1
  • Live Broadcast: Not Available
Full Package(including both Voice and Video)

The package structure is listed as follows:

./libs: including the required libraries

./samples: including the sample codes

  • Communication: Agora-iOS-Tutorial-Swift-1to1
  • Live Broadcast: Open Live

Step 2: Prepare the Environments

  1. Be sure that the following development environment requirements are satisfied:

    • Apple XCode version 6.0 or higher
    • iOS 7.0 or later
    • Real iOS devices with audio and video functionality
    • Prepare an App ID. Refer to Obtaining an App ID
  2. Be sure that the following libraries are ready.

    1. If you use the sample code downloaded in Step 1: Obtain the SDK , then no extra operation is required for this step.
    2. If you use the sample code downloaded from https://github.com/AgoraIO/OpenLive-iOS-Objective-C, follow the README.md file within the package.

Step 3: Demonstrate the Live Broadcast

Agora provides a sample code called Open Live. Follow this section to compile and run it.

Compiling the Sample Code

  1. Open OpenLive.xcodeproj using Xcode.
  2. Fill your own App ID in KeyCenter.swift.
../../_images/ios-live-demo-1.png
  1. Click the build and run button to compile the demo with real iOS devices connected.

Execute the Sample Code

You can demonstrate the Open Live sample code after the compilation. The demonstration requires at least two iOS devices:

  1. Open Open Live on the iOS device.
  2. Set the Host Mode.
  1. Enter a channel name in the field of Input Name of Live.
  2. Click Next on the keyboard and select Broadcaster.

After joining the channel, the host mode includes the following functions:

  • Enable/Disable the camera;
  • Mute/Unmute;
  • End the live broadcast;
../../_images/ios-live-1.png
  1. Set the Audience Mode.
  1. Enter the channel name set by the host.
  2. Click Next on the keyboard, and select Audience.