iOS
Quickstart​
This quickstart shows how to add RealtimeKit's Interactive Livestream SDK to your iOS applications.
Further down this guide we also explain how RealtimeKit's UI component library can help to build your UI faster with components specially made for Interactive Livestream applications.
You can also checkout our sample code for iOS.
Before Getting Started​
- Make sure you have a mechanism to get
authToken
from your server side which you would have received as part of Add Participant call.
Step 1: Install the SDK​
Swift Package Manager​
Add RealtimeKitUI
SDK through Swift Package Manager in Xcode. Use https://github.com/dyte-in/RealtimeKitUI as the package source.
Add the necessary fonts and permission entries in the info.plist
file. You can customize the strings shown in the permission pop-ups to match your audience preferences.
<key>NSBluetoothPeripheralUsageDescription</key>
<string>We will use your Bluetooth to access your Bluetooth headphones.</string>
<key>NSBluetoothAlwaysUsageDescription</key>
<string>We will use your Bluetooth to access your Bluetooth headphones.</string>
<key>NSCameraUsageDescription</key>
<string>For people to see you during meetings, we need access to your camera.</string>
<key>NSMicrophoneUsageDescription</key>
<string>For people to hear you during meetings, we need access to your microphone.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>For people to share, we need access to your photos.</string>
<key>UIBackgroundModes</key>
<array>
<string>audio</string>
<string>voip</string>
<string>fetch</string>
<string>remote-notification</string>
</array>
The UIBackgroundModes
key is used in the Info.plist
file of an iOS app to declare the app's supported background execution modes. This key is an array of strings that specifies the types of background tasks that the app supports. By declaring the background modes, the app can continue to run in the background and perform specific tasks even when it is not in the foreground.
It's important to note that the use of background modes should be justified and comply with Apple's App Store Review Guidelines. Apps that misuse background modes or unnecessarily run in the background may be rejected during the app review process.
Sources: Apple Developer Documentation: Declaring Your App's Supported Background Tasks
Step 2: Configure and Launch UI​
To set the initialization properties in the RealtimeKitUI
class, simply initialize RtkMeetingInfo
and provide the participant's authToken
Try this in viewDidAppear()
import RealtimeKitUI
import RealtimeKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
}
var rtkUikit: RealtimeKitUI!
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
let rtkMeetingInfo = RtkMeetingInfo(authToken: "<authToken>",
enableAudio: true,
enableVideo: true)
rtkUikit = RealtimeKitUI.init(meetingInfo: rtkMeetingInfo)
let controller = rtkUikit.startMeeting { [weak self] in
guard let self = self else {return}
self.dismiss(animated: true)
}
controller.modalPresentationStyle = .fullScreen
self.present(controller, animated: true)
}
}
Here is a pictorial representation of all the config options defined below.


