Skip to contentSkip to navigationSkip to topbar
On this page

Migrating from 3.x to 4.x


This guide provides an introduction to the 3.x Programmable Video iOS SDK and a set of guidelines to migrate an application from 3.x to 4.x.


Programming Model

programming-model page anchor

The programming model has not changed from 3.x to 4.x. Refer to our 3.x migration guide for a refresher on the Video iOS SDK models.


Xcode and iOS Version Support

xcode-and-ios-version-support page anchor

Twilio Video 4.x is built with Xcode 12. The framework can be consumed with previous versions of Xcode. However, re-compiling Bitcode when exporting for Ad Hoc or Enterprise distribution requires the use of Xcode 12.x. Twilio Video 4.2.0 and newer supports a minimum version of iOS 9.0 at build time, and 11.0 at run time.


Twilio Video 4.x is now delivered as a .xcframework and now includes the .dSYM and .bcsymbolmaps to aid in symbolication of crash reports.


Swift Package Manager Support

swift-package-manager-support page anchor

Twilio Video 4.x is now distributed via Swift Package Manager. To consume Twilio Video 4.x using Swift Package Manager, add the https://github.com/twilio/twilio-video-ios repository as a Swift Package.


In-App Screen Capture Support

in-app-screen-capture-support page anchor

You can now share video of your app's screen to a room using TVIAppScreenSource. TwilioVideo uses ReplayKit internally for in-app screen capture. TVIAppScreenSource conforms to TVIVideoSource and uses RPScreenRecorder to capture video of your app's screen. Here is a brief example:

1
if let source = AppScreenSource(), let track = LocalVideoTrack(source: source) {
2
room.localParticipant?.publishVideoTrack(track)
3
source.startCapture()
4
}

Discontinous Transmission (DTX)

discontinous-transmission-dtx page anchor

Discontinuous transmission (DTX) is enabled by default for the Opus codec. Disabling DTX will result in higher bitrate for silent audio while using the Opus codec. The TVIOpusCodec class now has a new initializer [TVIOpusCodec initWithDtxEnabled:] and a property dtxEnabled.


Removal of Carthage Support

removal-of-carthage-support page anchor

Carthage does not currently work with .xcframeworks as documented here(link takes you to an external page). Once Carthage supports binary .xcframeworks, Carthage distribution will be re-added in a future release.


Removal of Deprecated Items

removal-of-deprecated-items page anchor

The deprecated TVIVideoView APIs have been removed:

1
- VideoView.RenderingType
2
- [VideoView initWithFrame:delegate:renderingType:renderingType]

The deprecated TVIIceOptions and TVIIceOptionsBuilder APIs have been removed:

1
- TVIIceOptions.abortOnIceServersTimeout
2
- TVIIceOptionsBuilder.abortOnIceServersTimeout
3
- TVIIceOptions.iceServersTimeout
4
- TVIIceOptionsBuilder.iceServersTimeout

The TVIRemoteParticipant.connected property has been replaced with TVIParticipant.state.


  • This release has improved API for CallKit integration. In order to use CallKit with the SDK, you must set ConnectOptions.uuid while connecting to a Room. When ConnectOptions.uuid is set, it is your responsibility to enable and disable the audio device. You should enable the audio device in [CXProviderDelegate provider\:didActivateAudioSession:], and disable the audio device in [CXProviderDelegate provider\:didDeactivateAudioSession:].

Passing an uuid to make a Call with CallKit code snippets -

1
let uuid = UUID()
2
3
let connectOptions = ConnectOptions(accessToken: accessToken) { builder in
4
builder.uuid = uuid
5
}
6
7
let room = TwilioVideoSDK.connect(options: connectOptions, delegate: self)

ProviderDelegate implementation code snippets -

1
func provider(_ provider: CXProvider, didActivate audioSession: AVAudioSession) {
2
audioDevice.isEnabled = true
3
}
4
5
func provider(_ provider: CXProvider, didDeactivate audioSession: AVAudioSession) {
6
audioDevice.isEnabled = false
7
}
8
9
func providerDidReset(_ provider: CXProvider) {
10
audioDevice.isEnabled = false
11
}

Please note, if you are not using CallKit in your app, you must not set ConnectOptions.uuid while connecting to a Room. The Video SDK will enable the audio device for you when the uuid is nil.

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.