Level up your Twilio API skills in TwilioQuest, an educational game for Mac, Windows, and Linux. Download Now

メニュー

Expand
Rate this page:

Thanks for rating this page!

We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

iOS Platform Overview

Twilio's Programmable Video iOS SDK lets you add real time voice and video to your native iOS applications.

前提条件

  • Xcode 11.0+
  • Swift projects must use Swift 4.0 or higher
  • Support for iOS 11.0+

Run the QuickStart app

To get started with Twilio Video, you should download and run a QuickStart Application.

Using a Simulator

You can use the iOS Simulator that comes with Xcode to do your testing, but local video will not be shared since the Simulator cannot access a camera. If you have an iOS device, you can now run apps from Xcode on your device without a paid developer account.

The QuickStart repository contains additional examples. These examples demonstrate the usage of new features and also let you build more complex applications.

To add Video to your app, follow the Getting Started Guide

Add the SDK

The Twilio Video iOS SDK dynamic framework can be installed using Carthage, CocoaPods or manually, as you prefer. The Twilio Video iOS SDK is also distributed as a static library which can be manually installed.

変更

You can add Programmable Video for iOS by adding the following line to your Cartfile:

github "twilio/twilio-video-ios" ~> 3.0

続いて、carthage bootstrap を実行します。 (SDKを更新している場合は carthage update)

On your application targets’ General settings page, in the Linked Frameworks and Libraries section, drag and drop each framework you want to use from the Carthage/Build folder on disk.

On your application targets’ Build Phases settings tab, click the “+” icon and choose New Run Script Phase. Create a Run Script in which you specify your shell (ex: /bin/sh), add the following contents to the script area below the shell:

/usr/local/bin/carthage copy-frameworks

Add the paths to the frameworks you want to use under Input Files, e.g.:

$(SRCROOT)/Carthage/Build/iOS/TwilioVideo.framework

CocoaPod

source 'https://github.com/CocoaPods/Specs'

platform :ios, '11.0'

target 'TARGET_NAME' do
    pod 'TwilioVideo', '~> 3.0'
end

そして、pod install を実行してプロジェクトに依存関係をインストールします。

マニュアル

TwilioVideo.framework は既存のプロジェクトにドラッグ&ドロップできる動的なiOSフレームワークとして配布されています。

View all Video iOS Releases here or just download the latest Video dynamic framework here.

フレームワークをダウンロード、展開したら、XcodeプロジェクトのGeneral 設定ページに移動します。 Embedded Binariesセクションに、TwilioVideo.framework をドラッグ&ドロップします。 "Copy items if needed"にチェックが入っているかどうか確認し、Finishをクリックします。 これで、LibrariesセクションのEmbedded BinariesおよびLinked Frameworks双方に TwilioVideo.framework が追加されました。

Next, you will need to open your project's Linked Frameworks and Libraries configuration. You should see TwilioVideo.framework there already. Add the following frameworks to that list:

  • AudioToolbox.framework
  • VideoToolbox.framework
  • AVFoundation.framework
  • CoreTelephony.framework
  • GLKit.framework
  • CoreMedia.framework
  • SystemConfiguration.framework
  • libc++.tbd

In your Build Settings, you will also need to modify Other Linker Flags to include -ObjC.

Before distributing your app to the  App Store, you will need to strip the simulator binaries from the embedded framework. Navigate to your target's Build Phases screen and create a new Run Script Phase. Ensure that this new run script phase is after the Embed Frameworks phase. Paste the following command in the script text field:

/bin/bash "${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/TwilioVideo.framework/remove_archs"

Manual static library integration

libTwilioVideo is distributed as a static iOS library that you can drag and drop into you existing projects.

View all Video iOS Releases here or just download the latest Video static library here.

Once you've downloaded and unpacked the static library, drag and drop the lib and headers folders into your project. Ensure that "Copy items if needed" is checked and press Finish. This will add libTwilioVideo.a to the Linked Frameworks and Libraries section.

Next, you will need to open your project's Linked Frameworks and Libraries configuration. You should see libTwilioVideo.a there already. Add the following frameworks to that list:

  • AudioToolbox.framework
  • VideoToolbox.framework
  • AVFoundation.framework
  • CoreTelephony.framework
  • GLKit.framework
  • CoreMedia.framework
  • SystemConfiguration.framework
  • libc++.tbd

In your Build Settings, you will also need to modify Other Linker Flags to include -ObjC.

Background Modes

To allow a connection to a Room to be persisted while an application is running in the background, you must select the Audio, AirPlay, and Picture in Picture background mode from the Capabilities project settings page.

Xcode and iOS Version Support

SDK Version Minimum Xcode Requirement Minimum iOS Version Supported Architectures サポートされるデバイス
3.x Xcode 11.0 iOS 11.0 arm64, x86_64 iPhone 5s and later, iPad (5th generation) and later, iPad Air and later, iPad mini 2 and later
2.x Xcode 9.0 iOS 9.0 armv7, arm64, i386, x86_64 iPhone 4s and later, iPad 2 and later, iPad mini (1st generation) and later

Migrating from 2.x to 3.x

Our 3.0 releases are now "Generally Available" (GA) and represent our latest releases and adds support for:

  • Global low latency (GLL) signaling with IPv4 and IPv6 support.
  • Improved Swift APIs for a more idiomatic Swift development experience.
  • Support for UIScene and multi-window apps on iOS 13 and iPadOS 13.

Our 2.x releases will now only receive critical bug fixes. Support for the 2.x releases will cease as of January 10, 2020. Refer to our 3.x migration guide for migrating your applications from 2.x to 3.x.

Migrating from 1.x to 2.x

Our 2.0 releases are "Generally Available" (GA) and provide the following features:

  • Support for iOS 9.0+
  • H.264 encoding and decoding.
  • Codec preferences.
  • Bandwidth controls.
  • Subscription focused APIs.
  • Track names, Track level errors.
  • Data Tracks.
  • Custom Audio Devices.

Our 1.x releases are no longer supported. Refer to our 2.x migration guide for migrating your applications from 1.x to 2.x and our 3.x migration guide for migrating your applications from 2.x to 3.x.

Rate this page:

ヘルプが必要ですか?

誰しもが一度は考える「コーディングって難しい」。そんな時は、お問い合わせフォームから質問してください。 または、Stack Overflow でTwilioタグのついた情報から欲しいものを探してみましょう。