Skip to main content

iOS SDK

About

Check out the latest SDK at our Github Account

If you're looking some place to start you can do so at the Examples Repo

To use the AuviousSDK in your project, follow these steps:

Installation

AuviousSDK is available through as a CocoaPod. You can install it using one of the following ways:

  • Auvious Cocoa Pods Repo. Add the following sources to your Podfile
    source 'https://github.com/auvious/CocoaPodSpecs.git'
    Make sure you also include the official CocoaPods repo source or a valid mirror of it
    source 'https://cdn.cocoapods.org/'
    Last but not least, you need to add the AuviousSDK pod on all targets that will need it
    pod 'AuviousSDK', '1.4.0'
  • Auvious SDK github repo. This method only requires the following line on the target dependencies:
    pod 'AuviousSDK', :git => 'https://github.com/auvious/auvious-sdk-ios.git', :tag => '1.4.0'

Next you need to run pod install in order for AuviousSDK and it's dependencies to be installed in the project workspace.

Finally you'll need disable bitcode in 'Build Settings' and also add NSMicrophoneUsageDescription,NSCameraUsageDescription texts in Info.plist.


Setup Instructions

1. Info.plist Permissions

Add the following keys to your Info.plist to request camera and microphone access:

<key>NSCameraUsageDescription</key>
<string>Camera access is required for video calls.</string>
<key>NSMicrophoneUsageDescription</key>
<string>Microphone access is required for audio calls.</string>

2. Build Settings

Disable Bitcode in your target's Build Settings:

  • Navigate to Build Settings → Enable Bitcode and set it to No.

3. Background Audio (Optional)

If you want audio to continue when the app goes to the background, add the audio background mode to your Info.plist:

<key>UIBackgroundModes</key>
<array>
<string>audio</string>
</array>

Then enable it in the SDK configuration (see backgroundAudioEnabled below).

4. App Lifecycle Hooks

The SDK needs to be notified when the app moves between foreground and background. Add the following calls in your AppDelegate or SceneDelegate:

import AuviousSDK

// In applicationDidEnterBackground / sceneDidEnterBackground
AuviousConferenceSDK.sharedInstance.onApplicationPause()

// In applicationWillEnterForeground / sceneWillEnterForeground
AuviousConferenceSDK.sharedInstance.onApplicationResume()

Usage Example

The easiest way to add a conference to your app is using the built-in AuviousConferenceVCNew view controller.

import AuviousSDK

class ViewController: UIViewController {

func joinConference() {
// 1. Build the configuration
let config = AuviousConferenceConfiguration()
config.username = "<ticket>" // set the auvious ticket
config.baseEndpoint = "https://auvious.video/"
config.mqttEndpoint = "auvious.video"

// 2. Set call mode
config.callMode = .audioVideo

// 3. (Optional) Customize the UI
config.conferenceBackgroundColor = .black
config.cameraAvailable = true
config.microphoneAvailable = true
config.speakerAvailable = true
config.pipAvailable = true
config.screenSharingAvailable = false
config.backgroundAudioEnabled = false

// 4. Present the conference view controller
let conferenceVC = AuviousConferenceVCNew(configuration: config, delegate: self)
present(conferenceVC, animated: true)
}
}

// MARK: - AuviousSimpleConferenceDelegate

extension ViewController: AuviousSimpleConferenceDelegate {

func onConferenceSuccess() {
// Called when the conference ends normally
print("Conference ended successfully")
}

func onConferenceError(_ error: AuviousSDKGenericError) {
// Called on error (authentication failure, network issues, etc.)
switch error {
case .AUTHENTICATION_FAILURE:
print("Authentication failed — check credentials")
case .NETWORK_ERROR:
print("Network error")
case .PERMISSION_REQUIRED:
print("Camera or microphone permission denied")
case .INVALID_TICKET(let ticketId):
print("Invalid ticket: \(ticketId)")
default:
print("Conference error: \(error)")
}
}
}

Low-Level Conference API

For full control over the conference flow and UI, use AuviousConferenceSDK directly.

import AuviousSDK

class ConferenceManager: AuviousSDKConferenceDelegate {

func setup() {
AuviousConferenceSDK.sharedInstance.delegate = self

// Configure the SDK
AuviousConferenceSDK.sharedInstance.configure(
params: [:],
username: "<ticket>",
password: "<password>",
name: nil,
clientId: "<client-id>",
baseEndpoint: "https://auvious.video/",
mqttEndpoint: "auvious.video"
)

// Log in
AuviousConferenceSDK.sharedInstance.login(
onLoginSuccess: { [weak self] endpoint in
self?.joinConference()
},
onLoginFailure: { error in
print("Login failed: \(error)")
}
)
}

func joinConference() {
AuviousConferenceSDK.sharedInstance.joinConference(
conferenceId: "<conference-name>",
onSuccess: { [weak self] conference in
// Start publishing local audio/video
self?.publishLocalStream()
},
onFailure: { error in
print("Failed to join: \(error)")
}
)
}

func publishLocalStream() {
AuviousConferenceSDK.sharedInstance.startPublishLocalStreamFlow(type: .micAndCam)
}

func leaveConference() {
AuviousConferenceSDK.sharedInstance.leaveConference(
conferenceId: "<conference-name>",
onSuccess: { },
onFailure: { _ in }
)
}

// MARK: - AuviousSDKConferenceDelegate

func auviousSDK(didReceiveLocalVideoTrack localVideoTrack: RTCVideoTrack!) {
// Render the local video track in your UI
}

func auviousSDK(didReceiveRemoteStream stream: RTCMediaStream, streamId: String,
endpointId: String, type: StreamType) {
// Render the incoming remote stream in your UI
}

func auviousSDK(didReceiveLocalStream stream: RTCMediaStream, streamId: String,
type: StreamType) {
// Local stream is ready
}

func auviousSDK(onError error: AuviousSDKError) {
print("SDK error: \(error)")
}

func auviousSDK(didChangeState newState: StreamEventState, streamId: String,
streamType: StreamType, endpointId: String) {
// React to stream state transitions (connecting, connected, disconnected, etc.)
}

func auviousSDK(trackMuted type: StreamType, endpointId: String) { }
func auviousSDK(trackUnmuted type: StreamType, endpointId: String) { }
func auviousSDK(conferenceOnHold flag: Bool) { }
func auviousSDK(didReceiveConferenceEvent event: ConferenceEvent) { }
func auviousSDK(didRejoinConference conference: ConferenceSimpleView) { }
func auviousSDK(recorderStateChanged toActive: Bool) { }
func auviousSDK(agentPortraitMode flag: Bool, endpointId: String) { }
func auviousSDK(screenSharingStarted: Bool) { }
func auviousSDK(screenSharingStopped: Bool) { }
func auviousSDK(didResumeFromBackground withActiveAudio: Bool) { }
}

Configuration Options Reference

AuviousConferenceConfiguration

Used when presenting AuviousConferenceVCNew for the built-in conference UI.

Authentication & Connection

PropertyTypeDescription
usernameStringUsername (or ticket) used to authenticate with the Auvious platform.
passwordStringPassword used to authenticate.
grantTypeStringOAuth grant type. Default: "password".
clientIdStringClient identifier registered on the Auvious platform. Default: "customer"
conferenceStringName of the conference room to join or create.
baseEndpointStringBase URL of the Auvious API (e.g. "https://auvious.video/").
mqttEndpointStringHostname of the MQTT WebSocket broker (e.g. "auvious.video").

Call Behaviour

PropertyTypeDefaultDescription
callModeAuviousCallMode.audioVideoStream mode for the call. Use .audio for audio-only, .video for video-only, or .audioVideo for both.
enableSpeakerBooltrueRoute audio to the loudspeaker on join.
backgroundAudioEnabledBoolfalseKeep audio running when the app moves to the background. Requires the audio UIBackgroundMode in Info.plist.
participantNameString?nilOptional display name shown to other participants.

UI Controls

PropertyTypeDefaultDescription
conferenceBackgroundColorUIColor.darkGrayBackground colour of the conference view.
cameraAvailableBooltrueShow the camera toggle button.
microphoneAvailableBooltrueShow the microphone mute/unmute button.
speakerAvailableBooltrueShow the speaker toggle button.
pipAvailableBooltrueShow the Picture-in-Picture button.
screenSharingAvailableBooltrueShow the screen-sharing button.

AuviousConferenceSDK — Key Properties

PropertyTypeDescription
delegateAuviousSDKConferenceDelegate?Receives stream, state, and error events.
publishVideoResolutionPublishVideoResolutionVideo quality for the outgoing stream. .min (640×480), .mid (960×720), .max (1920×1080).
isLoggedInBoolWhether the SDK is currently authenticated. Read-only.
userEndpointIdString?The current user's endpoint identifier. Read-only.

Enumerations

AuviousCallMode

ValueDescription
.audioAudio-only call.
.videoVideo-only call.
.audioVideoAudio and video call.

StreamType

ValueDescription
.micAudio stream only.
.camVideo stream only.
.micAndCamAudio and video stream.
.screenScreen-sharing stream.

PublishVideoResolution

ValueResolution
.min640 × 480
.mid960 × 720
.max1920 × 1080

AuviousSDKGenericError

ValueDescription
.AUTHENTICATION_FAILURECredentials were rejected by the platform.
.PERMISSION_REQUIREDCamera or microphone permission was denied by the user.
.NETWORK_ERRORA network-level failure occurred.
.CALL_REJECTEDThe call was rejected by the remote party.
.CONFERENCE_MISSINGThe specified conference room does not exist.
.INVALID_TICKET(ticketId)The provided ticket is invalid or expired.
.UNKNOWN_FAILUREAn unexpected error occurred.