Skip to content
This repository was archived by the owner on Feb 4, 2025. It is now read-only.

Standard initialization

VTCoco edited this page Oct 9, 2019 · 4 revisions

Note : this article is only about integrating the voxeet-ios-sdk into your app. If you are using UI components, please head to the UXKit.

Before any use of the SDK into your project, please head to the developer portal to create your account or login and retrieve your api keys.

The consumer key and the consumer secret will let you use the SDK and to bring Video and Audio features to your users.

Adding the SDK into your app

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).

Capabilities

Permissions

Add those permissions right into your app's Info.plist file:

  • NSMicrophoneUsageDescription
  • NSCameraUsageDescription

Adding the SDK into your app

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 VoxeetSDK into your Xcode project using Carthage, specify it in your Cartfile:

github "voxeet/voxeet-ios-sdk" ~> 1.0

Run carthage update to build the frameworks and drag VoxeetSDK.framework and WebRTC.framework into your Xcode project. More information at https://github.com/Carthage/Carthage#if-youre-building-for-ios-tvos-or-watchos.

Manually

Download the lastest release zip:

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'.

Initializing the SDK

The SDK as 2 main initialization mode. We will focus on the fastest one but an other article will guide into our OAuth feature.

To finish the SDK initialization, you simply need to use the initialize singleton method available in the VoxeetSDK class.

VoxeetSDK.shared.initialize(consumerKey: "YOUR_CONSUMER_KEY", consumerSecret: "YOUR_CONSUMER_SECRET")

Opening a session

When User's information is created alongside the SDK use, those information are only set in memory (the classes only hold in-memory information)

Definition

The SDK let you connect an user using directly using the open method from the session service.

Usage

let user = VTUser(externalID: "1234", name: "Username", avatarURL: "https://voxeet.com/logo.jpg")
VoxeetSDK.shared.session.open(user: user) { error in }

Closing a session

Disconnecting users will unregister push notifications and currently connected WebSockets to the servers dedicated to the Voxeet functionnalities.

Definition

The SDK let you disconnect an user using directly the close method from the session service.

Usage

VoxeetSDK.shared.session.close { error in }

And that's it, from this point, any SDK methods will be available and ready to go.

Clone this wiki locally