Introduction
Prerequisites
- An Agora developer account (see How To Get Started with Agora)
- Xcode 11.0 or later
- iOS device with iOS 13.0 or later (as this project uses SF Symbols)
- A basic understanding of iOS development
- CocoaPods
Setup
platform :ios, ‘9.0’ target ‘Project-Name’ do pod ‘AgoraRtcEngine_iOS’, ‘~> 3.1.0’ end
pod init
, and open the .xcworkspace file to get started.
Create the App

remoteUserIDs
and userVideoLookup
, which will keep track of the broadcasters/streamers.When userVideoLookup
is set or updated, reorganiseVideos
is called to organize all of the streamed video feeds into a grid formation. Of course, a grid formation is not required, but if you want to implement the same thing, the reorganiseVideos
method is provided in the example project. Here’s a link to it:
The hostButton has a target set as toggleBroadcast
. This method is found right at the bottom of the gist. As you can see, it toggles the value of self.userRole
between .broadcaster
and .audience
, and then sets the client role using setClientRole
. When the local client starts streaming, additional buttons should appear (for audio and video settings) but those buttons are displayed only after the client role has been changed, which is signaled by the delegate callback.
AgoraRtcEngineDelegate
, so we should add that protocol to our class, along with some callback methods.The main callback methods we need for a basic streaming session are didJoinedOfUid, didOfflineOfUid, didClientRoleChanged, and firstRemoteVideoDecodedOfUid.
isHidden
property of the button container is set to false or true, respectively.Other Resources
For more information about building applications using Agora.io SDKs, take a look at the Agora Video Call Quickstart Guide and Agora API Reference.
I also invite you to join the Agoira.io Developer Slack community.
Want to build Real-Time Engagement apps?
Get started with 10,000 free minutes today!
If you have questions, please call us at 408-879-5885. We’d be happy to help you add voice or video chat, streaming, and messaging into your apps.

Stay inspired by accessing all RTE2020 session recordings. Gain access to innovative Real-Time-Engagement content and start innovating today.