This document describes how to quickly integrate RT-Cube’s MLVB LiteAVSDK for iOS into your project.
You can use CocoaPods to automatically load the SDK or manually download the SDK and import it into your project.
Enter the following command in a terminal window (you need to install Ruby on your macOS first):
sudo gem install cocoapods
Go to the directory of your project and enter the following command to create a Podfile in the directory.
pod init
There are two ways to edit the Podfile:
platform :ios, '9.0'
target 'App' do
pod 'TXLiteAVSDK_International', :podspec => 'https://liteav.sdk.qcloud.com/pod/liteavsdkspec/TXLiteAVSDK_International.podspec'
end
Enter the following command in a terminal window to update the local repository file and install LiteAVSDK:
pod install
Or, run the following command to update the local repository:
pod update
An XCWORKSPACE project file integrated with LiteAVSDK will be generated. Double-click to open the file.
TXLiteAVSDK_International.framework
and the libraries it depends on:libz.tbd
libc++.tbd
libresolv.tbd
libsqlite3.tbd
Accelerate.framework
OpenAL.framework
5. Click Build Settings, search for Other Linker Flags
, and add -ObjC
.
To use the audio/video features of the SDK, you need to grant it mic and camera permissions. Add the two items below to Info.plist
of your application to display pop-up messages asking for mic and camera permissions.
There are two ways to import the SDK in your project code.
Method 1: import the SDK module in the files that need to use the SDK’s APIs in your project
@import TXLiteAVSDK_International;
Method 2: import a specific header file in the files that need to use the SDK’s APIs in your project
#import "TXLiteAVSDK_International/TXLiteAVSDK.h"
Log in to the CSS console, go to MLVB SDK > License Management, and click Get License to obtain a trial license. For detailed directions, see Applying for trial license. You will get two strings: a license URL and a decryption key.
Before you use LiteAVSDK features in your application, complete the following configurations (preferably in - [AppDelegate application:didFinishLaunchingWithOptions:]
):
@import TXLiteAVSDK_International;
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
NSString * const licenceURL = @"<The license URL obtained>";
NSString * const licenceKey = @"<The key obtained>";
//TXLiveBase can be found in the "TXLiveBase.h" header file
[TXLiveBase setLicenceURL:licenceURL key:licenceKey];
NSLog(@"SDK Version = %@", [TXLiveBase getSDKVersionStr]);
}
@end
Can I run LiteAVSDK in the background?
Yes, you can. If you want the SDK to run in the background, select your project, under the Capabilities tab, set Background Modes to ON, and check Audio, AirPlay and Picture in Picture, as shown below:
Was this page helpful?