Voxeet UXKit iOS
Requirements
- Operating systems: iOS 9.0 and later versions
- IDE: Xcode 11+
- Languages: Swift 5+, Objective-C, React Native, Cordova
- Supported architectures: armv7, arm64, i386, x86_64
Sample application
A sample application is available on this GitHub repository. VoxeetConferenceKit is a framework based on VoxeetSDK (https://github.com/voxeet/voxeet-ios-sdk).
Installing the iOS SDK
1. Get your credentials
Get a consumer key and consumer secret for your app from your developer account dashboard.
If you are a new user, you'll need to sign up for a Voxeet developer account and add an app. You can create one app with a trial account. Upgrade to a paid account for multiple apps and to continue using Voxeet after your trial expires. We will give you dedicated help to get you up and running fast.
2. Project setup
Enable background mode (go to your target settings -> 'Capabilities' -> 'Background Modes')
- Turn on 'Audio, AirPlay and Picture in Picture'
- Turn on 'Voice over IP'
If you want to support CallKit (receiving incoming call when application is killed) with VoIP push notification, enable 'Push Notifications' (you will need to upload your VoIP push certificate to the Voxeet developer portal).
Privacy permissions, add two new keys in the Info.plist:
- Privacy - Microphone Usage Description
- Privacy - Camera Usage Description
3. Installation
Carthage
Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.
You can install Carthage with Homebrew using the following command:
$ brew update
$ brew install carthage
To integrate VoxeetConferenceKit into your Xcode project using Carthage, specify it in your Cartfile
:
github "voxeet/voxeet-ios-conferencekit" ~> 1.0
Run carthage update
to build the frameworks and drag VoxeetConferenceKit.framework
, VoxeetSDK.framework
and WebRTC.framework
into your Xcode project (needs to be dropped in 'Embedded Binaries').
More information at https://github.com/Carthage/Carthage#if-youre-building-for-ios-tvos-or-watchos.
Manually
Download the lastest release zip:
VoxeetConferenceKit: https://github.com/voxeet/voxeet-ios-conferencekit/releases and VoxeetSDK: https://github.com/voxeet/voxeet-ios-sdk/releases
Unzip and drag and drop frameworks into your project, select 'Copy items if needed' with the right target. Then in the general tab of your target, add the VoxeetConferenceKit.framework
, VoxeetSDK.framework
and WebRTC.framework
into 'Embedded Binaries'.
4. Dependencies
VoxeetConferenceKit is also using some external libraries like SDWebImage for downloading and caching images from the web (users' avatars). You can either download this framework at this link or install it with Carthage (or CocoaPods).
At the end 'Embedded Binaries' and 'Linked Frameworks and Libraries' sections should look like this:
(WebRTC.framework missing on this screenshot and Kingfisher has been replaced by SDWebImage)
Voxeet Conference Kit usage
initialize
Use these methods to initialize the Voxeet frameworks.
Parameters
consumerKey
String - The consumer key for your app from your developer account dashboard.consumerSecret
String - The consumer secret for your app from your developer account dashboard.
Code examples
import VoxeetSDK
import VoxeetConferenceKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Voxeet SDKs initialization.
VoxeetSDK.shared.initialize(consumerKey: "YOUR_CONSUMER_KEY", consumerSecret: "YOUR_CONSUMER_SECRET")
VoxeetConferenceKit.shared.initialize()
// Example of public variables to change the conference behavior.
VoxeetSDK.shared.pushNotification.type = .none
VoxeetSDK.shared.conference.defaultBuiltInSpeaker = false
VoxeetSDK.shared.conference.defaultVideo = false
VoxeetConferenceKit.shared.appearMaximized = true
VoxeetConferenceKit.shared.telecom = false
return true
}
}
References
https://github.com/voxeet/voxeet-ios-sdk#initialize-the-voxeet-sdk
connect
This method is optional.
Connect a session is like a login, however the SDK needs to be initialized with connectSession
sets to false
. This method can be useful if CallKit is implemented (VoIP push notifications) because once the session is openned, notifications can be received if there is an invitation.
Parameters
user
VTUser? - A user to be linked to our server.completion
((_ error: NSError?) -> Void)? - A block object to be executed when the server connection sequence ends. This block has no return value and takes a singleNSError
argument that indicates whether or not the connection to the server succeeded.
Examples
let user = VTUser(externalID: "1234", name: "Username", avatarURL: "https://voxeet.com/logo.jpg")
VoxeetSDK.shared.session.connect(user: user) { error in }
References
https://github.com/voxeet/voxeet-ios-sdk#connect
disconnect
This method is optional. Close a session is like a logout, it will stop the socket and stop sending VoIP push notification.
Parameters
completion
((_ error: NSError?) -> Void)? - A block object to be executed when the server connection sequence ends. This block has no return value and takes a singleNSError
argument that indicates whether or not the connection to the server succeeded.
Examples
VoxeetSDK.shared.session.disconnect { error in }
References
https://github.com/voxeet/voxeet-ios-sdk#disconnect
start conference
Start the conference UI.
Examples
// Create a conference.
VoxeetSDK.shared.conference.create(success: { json in
guard let confID = json?["conferenceId"] as? String else { return }
// Join the created conference.
VoxeetSDK.shared.conference.join(conferenceID: confID, video: false, userInfo: nil, success: { json in
}, fail: { error in
})
}, fail: { error in
})
References
https://github.com/voxeet/voxeet-ios-sdk#create https://github.com/voxeet/voxeet-ios-sdk#join
stop conference
Stop the conference UI.
Examples
VoxeetSDK.shared.conference.leave { error in }
References
https://github.com/voxeet/voxeet-ios-sdk#leave
useful variables
By default, conference appears maximized. If false, the conference will appear minimized.
VoxeetConferenceKit.shared.appearMaximized = true
If someone hangs up, everybody is kicked out of the conference.
VoxeetConferenceKit.shared.telecom = false
CallKit sound and image
If CallKitSound.mp3
is overridden, the ringing sound will be replaced by your mp3.
Same as IconMask.png
if overridden, it will replace the default CallKit image by yours (40x40px).
Tech
The Voxeet iOS SDK and ConferenceKit rely on these open source projects:
- SDWebImage, provides an async image downloader with cache support.
- Starscream, a conforming WebSocket (RFC 6455) client library in Swift for iOS and OSX.
- Alamofire, an HTTP networking library written in Swift.
- SwiftyJSON, a tool for handling JSON data in Swift.
SDK version
1.2.7
© Voxeet, 2020