Adding SDK to your application using Cocoapods
Install the CocoaPods (see getting starting guide)
Follow the instructions to create or modify Podfile
Add VoxImplantSDK dependency to your target in Podfile
platform :ios, '9.0' use_frameworks! target 'MyApp' do // other dependencies and configurations pod 'VoxImplantSDK' end
Run "pod install" command in the terminal from your project directory
Open the *.xcworkspace file that was created. This should be the file you use every day to create your app.
You can see the example of Podfile in our demo repository.
You can also use bitcode assemblies in your builds. Despite having this option, the usage of bitcode libraries is not recommended for debug/testing builds because of its size. The VoxImplantWebRTC bitcode assembly is unoptimized and around 700 Mb. Due to the size, it allows Apple services to pick only the required components and methods from it. See the details here.
Include the NSMicrophoneUsageDescription and NSCameraUsageDescription keys in your app's Info.plist file and provide reasonable strings for these keys. If your app attempts to access any of the device’s microphones or cameras without corresponding reasonable strings, your app exits.
You also have to declare four Background Modes:
- Audio and AirPlay
- Background fetch
- Remote notifications
- Voice over IP
Enabling the Background Modes option adds the UIBackgroundModes key to your app’s Info.plist file. Selecting checkboxes in Xcode adds the corresponding background mode values to that key.
Then create a VIClient instance and initialize it as specified in the documentation:
Connect and Log In
Firstly, you need to connect to the Voximplant cloud. As a result, the clientSessionDidConnect: or client:sessionDidFailConnectWithError: event will be sent to VIClientSessionDelegate. After the connection is established, use the loginWithUser:password:success:failure: function to authenticate. For example, when you need to login user myuser to application myapp in your Voximplant account named myaccount with password mypass: