Integrating Cloud Contact Center iOS Agent SDK
This topic mainly introduces how to quickly integrate Cloud Contact Center iOS Agent SDK into your project. Just follow the steps for configuration, and you can complete the integration of the SDK.
Environment Requirements
Xcode 9.0+.
A real iPhone or iPad running iOS 9.0 or later.
The project has been configured with a valid developer signature.
Integrating SDK
Solution 1: Using CocoaPods
1. Install CocoaPods.
Enter the following command in a terminal window (you need to install Ruby on your Mac first):
sudo gem install cocoapods
2. Create a Podfile.
Go to the directory of your project and enter the following command to create a Podfile in the directory.
3. Edit the Podfile
Edit the Podfile according to your project needs:
platform :ios, '11.0'
target 'App' do
pod 'TCCCSDK_Ios', :podspec => 'https://tccc.qcloud.com/assets/doc/Agent/CppSDKRelease/TCCCSDK_Ios.podspec'
end
4. Update the local repository and install the SDK
Enter the following command in the Terminal window to update the local library file and install the SDK:
Alternatively, run the following command to update the local repository:
An XCWORKSPACE project file integrated with the SDK will be generated. Double-click to open it.
Solution 2: Manual Download
2. Open your Xcode project, select the target to run, and click Build Phases.
3. Click Link Binary with Libraries to expand, and click the "+" icon below to add dependency libraries.
4. Add the downloaded TCCCSDK.Framework, TXFFmpeg.xcframework, and TXSoundTouch.xcframework, and the required dependency libraries GLKit.framework, AssetsLibrary.framework, SystemConfiguration.framework, libsqlite3.0.tbd, CoreTelephony.framework, AVFoundation.framework, OpenGLES.framework, Accelerate.framework, MetalKit.framework, libresolv.tbd, MobileCoreServices.framework, libc++.tbd, and CoreMedia.framework.
5. Click General, select Frameworks, Libraries, and Embedded Content. Check whether the dynamic libraries TCCCSDK.framework, TXFFmpeg.xcframework, and TXSoundTouch.xcframework have been added, and whether Embed & Sign is correctly selected. If not, click the "+" icon below to add them in order.
6. Add -ObjC configuration in Other Linker Flags of the project target Build Settings.
Configuring Permissions
1. If you need to use the audio and video features provided by the SDK, you need to authorize the use of the microphone for the app. Add the corresponding microphone prompt information when the system pops up the authorization dialog box in the Info.plist of the app.
2. If you need the app to continue running related features in the background, you can select the current project in Xcode, set Background Modes in Capabilities to ON, and select Audio, AirPlay and Picture in Picture, as shown below:
Code Implementation
We currently provide Swift, OC, and C++ interfaces for developers to choose from. You can use the following code to import the header file:
import TCCCSDK
let tcccSDK: TCCCWorkstation = {
return TCCCWorkstation.sharedInstance()
}()
let version = TCCCWorkstation.getSDKVersion()
#import "TCCCSDK/tccc/platform/apple/TCCCWorkstation.h"
- (TCCCWorkstation*)tcccSDK {
if (!_tcccSDK) {
_tcccSDK = [TCCCWorkstation sharedInstance];
}
return _tcccSDK;
}
NSString* version = [TCCCWorkstation getSDKVersion];
#include "TCCCSDK/tccc/include/ITCCCWorkstation.h"
using namespace tccc;
ITCCCWorkstation* tcccSDK = getTCCCShareInstance();
const char * version = tcccSDK->getSDKVersion();
FAQs
How do I view Cloud Contact Center logs?
The logs of Cloud Contact Center are compressed and encrypted by default, with suffix .log.
iOS log path: sandbox/Documents/tccc
Are the callbacks on iOS all on the main thread?
All callbacks in the Swift and OC interfaces are on the main thread, so developers do not need to handle them specially. However, callbacks in c++ are not on the main thread and need to be assessed by the business layer and then switched to the main thread:
if ([NSThread isMainThread]) {
return;
}
dispatch_async(dispatch_get_main_queue(), ^{
});
Was this page helpful?