Latest | 1.5 |
---|---|
Homepage | https://github.com/Gruveo/videola-ios-sdk |
License | MIT |
Platforms | ios 9.0 |
Dependencies | GruveoWebRTC |
Videola.io SDK for iOS
The Videola.io SDK for iOS and a sample project.
Pod Installation
To add the Videola.io SDK for iOS to your app, you will need CocoaPods, which is a dependency manager for Objective-C and Swift. You can install CocoaPods with the following command:
$ gem install cocoapods
Podfile
To integrate the Videola.io SDK into your Xcode project using CocoaPods, add the VideolaSDK
pod to your Podfile
:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
target 'TargetName' do
pod 'VideolaSDK'
end
Then, run the following command:
$ pod install
Application Setup and Usage
- Add
NSCameraUsageDescription
andNSMicrophoneUsageDescription
to your application’s Info.plist - Set “Enable Bitcode” to NO in Target -> Build Settings -> Enable Bitcode
- Check the "Audio, AirPlay, and Picture in Picture" checkbox under Capabilities -> Background Modes
- Import
VideolaSDK
to theAppDelegate
and yourViewController
class:import VideolaSDK
- Register your сlient ID after application startup:
VideolaCallManager.setClientId("demo")
- Set delegate for
VideolaCallManager
in theviewDidLoad
function:VideolaCallManager.setDelegate(self)
- Implement creation of the Videola.io call screen:
VideolaCallManager.callCode(code, videoCall: true, textChat: true, on: self) { (creationError) in if creationError != CallInitError.none { // show error here } }
- Implement the delegate function for token signing. Warning: The sample implementation below uses a signing endpoint provided by Videola.io and will only work for the
demo
client ID:
func request(toSignApiAuthToken token: String!) {
guard let url = URL(string: "https://demo.videola.io/signer") else {
VideolaCallManager.authorize(nil)
return
}
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("text/plain", forHTTPHeaderField: "Content-Type")
request.httpBody = token.data(using: String.Encoding.utf8)
session.dataTask(with: request, completionHandler: { (data, response, error) in
if let data = data, let signedToken = String(data: data, encoding: String.Encoding.utf8) {
VideolaCallManager.authorize(signedToken)
} else {
VideolaCallManager.authorize(nil)
}
}).resume()
}
9. Implement the other useful delegate functions:
```swift
func callEstablished() {}
func callEnd(_ reason: VideolaCallEndReason) {}
func recordingStateChanged() {}
func recordingFilename(_ filename: String!) {}
- Build and run your application.
Latest podspec
{ "name": "VideolaSDK", "version": "1.5", "summary": "Official Videola SDK for adding video chat functionality to your iOS app", "description": "The Videola SDK for iOS lets you quickly and easily add a white-label screen with a video calling UI to your iOS app. It is the ready-to-use solution you need to add video and voice calling to your iOS app in minutes.", "homepage": "https://github.com/Gruveo/videola-ios-sdk", "license": { "type": "MIT", "file": "LICENSE" }, "authors": "Videola", "platforms": { "ios": "9.0" }, "source": { "git": "https://github.com/Gruveo/videola-ios-sdk.git", "tag": "1.5" }, "dependencies": { "GruveoWebRTC": [ "~> 1.65.25.2" ] }, "vendored_frameworks": "VideolaSDK/VideolaSDK.framework" }
Fri, 22 Mar 2019 11:24:21 +0000