iOS SDK for interfacing with the Amazon Kinesis Video Streams Signaling Service.
This sample demonstrates the Amazon Kinesis Video Streams and Kinesis Video Signaling framework found in the AWS Mobile SDK for iOS with Google WebRTC.
For more information, see What Is Amazon Kinesis Video Streams with WebRTC and WebRTC SDK for iOS. You can learn more about Google WebRTC’s native API’s here.
To download the WebRTC SDK in iOS, run the following command:
git clone https://github.com/awslabs/amazon-kinesis-video-streams-webrtc-sdk-ios.git
Install XCode. You can install XCode from https://developer.apple.com/download/all/
The AWS Mobile SDK for iOS is available through CocoaPods. If CocoaPods is not installed, install it using the following command. Note that Ruby will also be installed, as it is a dependency of Cocoapods.
brew install cocoapods
pod setup
The following cocoa pod dependencies are included in the Podfile and need to be pod install
‘ed:
Change directories to the directory containing the Podfile and run the install
command:
cd amazon-kinesis-video-streams-webrtc-sdk-ios/Swift
pod cache clean --all
pod install --repo-update
Create an Amazon Cognito User Pool. Follow steps 2-3 in the AWS KVS Android WebRTC Repo.
To open the project, you can choose between these two methods:
xed .
Open KvsiOSApp/Constants.swift. Set CognitoIdentityUserPoolRegion
, CognitoIdentityUserPoolId
, CognitoIdentityUserPoolAppClientId
, CognitoIdentityUserPoolAppClientSecret
and CognitoIdentityPoolId
to the values obtained in step 3.
swift
let cognitoIdentityUserPoolRegion = AWSRegionType.USWest2
let cognitoIdentityUserPoolId = "us-west-2_qRsTuVwXy"
let cognitoIdentityUserPoolAppClientId = "0123456789abcdefghijklmnop"
let cognitoIdentityUserPoolAppClientSecret = "abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmno"
let cognitoIdentityPoolId = "us-west-2:01234567-89ab-cdef-0123-456789abcdef"
Open KvsiOSApp/awsconfiguration.json and replace the “REPLACEME” values with the values obtained earlier.
json
{
"Version": "1.0",
"CredentialsProvider": {
"CognitoIdentity": {
"Default": {
"PoolId": "us-west-2:01234567-89ab-cdef-0123-456789abcdef",
"Region": "us-west-2"
}
}
},
"IdentityManager": {
"Default": {}
},
"CognitoUserPool": {
"Default": {
"AppClientSecret": "abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmno",
"AppClientId": "0123456789abcdefghijklmnop",
"PoolId": "us-west-2_qRsTuVwXy",
"Region": "us-west-2"
}
}
}
To build and run, click the play button at the top of the XCode UI.
Building the iOS sample application installs the AWSKinesisVideoWebRTCDemoApp on your iOS device. Using this app, you can verify live audio/video streaming between mobile, web and IoT device clients (camera). The procedure below describes some of these scenarios.
Complete the following steps:
Scripting Bridge could not launch application /Applications/Xcode.app
XCode.app
is in your Applications
folder.No such module ‘AWSCognitoIdentityProvider’
.xcworkspace
file or using the xed .
command, not the .xcodeproj
file.Could not build module ‘UIKit’
rm -rf ~/Library/Caches/CocoaPods
rm -rf Pods
rm -rf ~/Library/Developer/Xcode/DerivedData
pod deintegrate
rm -f Podfile.lock
pod setup
pod install --repo-update
Product > Clean Build Folder
(or using ⌘+⇧+K) before clicking the play button.Could not find module ‘AWSMobileClient’ for target ‘arm64-apple-ios-simulator’; found: x86_64-apple-ios-simulator
Build settings
, and check that All
and Combined
are selected.Architectures > Architectures
setting, add x86_64
.Finder > Applications > XCode > Get Info > ✓ Enable Rosetta
Terminating app due to uncaught exception ‘NSInternalInconsistencyException’, reason: ‘Invalid region type.’
Unable to create channel. Please validate all the input fields
Constants.swift
and awsconfiguration.json
are set correctly. See the examples above to ensure your values match the same format.kinesisvideo
permissions.This library is licensed under the Apache 2.0 License.