Call Capability (iOS-SDK)
# Call Capability (iOS-SDK)
Sobot provides the enterprises with a full set of perfect intelligent agent solutions. The Sobot Telemarketing SDK provides support for all call-related functions, and allows enterprises to complete call tasks, outbound calls, call monitoring, call recording, and other operations with the accounts they used.
Sobot Telemarketing SDK has the following features:
- Provide a complete process of login - use - logout.
- Consist of two login modules: external login with synchronized token and regular login with username and password.
- Support call phone registration, call record query, call monitoring, agent status switching and other basic functions.
Related limits and notes :
iOS SDK new version supports versions above iOS9, iPhone, and iPad, and supports both portrait mode and landscape mode.
The currently released XCode version is XCode 14.2. It is recommended to use the new version for development.
iOS requires MIC permission; otherwise, some functions are not available.
SDK cannot be used in conjunction with the call function in the Sobot APP and the call function in the Sobot PC console.
# File Introduction
# ● Schematic Diagram of Integration Process
# ● File Description
SDK files include (SobotCall.framework, SobotCommon.framework, SobotCall.bundle and SobotCommon.bundle), SobotCallDemo and Doc related documentation.
File | Description |
---|---|
SobotTelemarketingSDK.framework | Sobot Telemarketing SDK code library |
SobotCallLib.framework | Sobot call SDK code library |
SobotCommon.framework | Sobot code basic dependency library |
SobotCommon.bundle | Resource library of basic tool package, containing image files, multilingual files and colors |
SobotCall.bundle | SDK resource library, containing image files, multilingual files and colors |
SobotTMApi.h | The file provides an access function |
SobotTMParameter.h | Basic UI configuration param class |
SobotCallCacheEntity.h | Basic function param class (domain name, color, language, display mode, etc.) |
SobotTMHomeV6Controller.h | Call entry interface |
SobotTMClient.h | Basic function |
# Integration Method
# ● Manual Integration
Download link: iOS_TMSDK (opens new window)
Unzip iOS_TMSDK and add necessary files of SobotTelemarketingSDK.framework, SobotCallLib.framework, SobotCommon.framework, SobotCommon.bundle and SobotCall.bundle to your project.
# ● CocoaPods Integration
Add in podfile:
// Use the latest version
pod 'SobotTMSDK'
2
3
If you cannot find the latest version, run the following command to update the CocoaPods pod:
pod repo update --verbose
If you cannot update to the latest version, you can delete the index file and try again
rm ~/Library/Caches/CocoaPods/search_index.json
2
3
4
Delete pod cache:
Delete the pod file folder in the code,
pod cache clean SobotTMSDK
and then pod install
2
3
# Function Description
# ● Domain Name Settings
Domain name description:
Default SaaS platform domain name is: https:// api.sobot.com。
If you use the Tencent Cloud server, please set as: https:// www.soboten.com。
If you use localized deployment, please use your deployed server domain name.
Sample code:
SobotCallCacheEntity *config = [[SobotCallCacheEntity alloc] initWithBundleName:@"SobotCall"];
// General API service URL
config.openApiHost = @"https:// api.sobot.com";
// Call API service URL
config.callApiHost = @"https:// openapi.sobot.com";
// Agent signaling service
config.stompSocketUri = @"wss:// openapi.sobot.com/v6.0.0/webmsg/cc-webmsg";
// janus message monitoring service
config.janusSocketUri = @"wss:// rtc.sobot.com.cn/janus";
// janus proxy service
config.sipProxy = @"sip:192.168.30.68:5060";
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# ● Initialization
Initialization param and call method: Initialize information SobotCallCacheEntity; set the function related attributes; the initialization method is executed locally, with no asynchronous requests generated, and it takes effect immediately after setting.
The main call code is as follows:
[Note: Before initiating Sobot telemarketing SDK, call the initialization API initWithConfig; otherwise, the SDK cannot be initiated.]
The method is as follows:
/// Initialization configuration
/// @param config SobotCallCacheEntity Configuration class, domain name/internationalization/resource
/// @param kitInfo SobotKitConfig configuration class
/// @param resultBlock Initialization callback (NSInteger code,id _Nullable obj,NSString *_Nullable msg);
+(void)initWithConfig:(SobotCallCacheEntity *) config kitInfo:(SobotTMParameter *)kitInfo result:(SobotTMResultBlock) resultBlock;
2
3
4
5
6
7
8
9
10
11
Param:
Param | Type | Required | Description |
---|---|---|---|
config | NSObject | Yes | Basic software configuration, designating domain name, resource name, language, etc. |
kitInfo | NSObject | Yes | UI related configuration |
resultBlock | Block | No | Initialization status callback, code=1: succeed |
Sample code:
SobotCallCacheEntity *config = [[SobotCallCacheEntity alloc] initWithBundleName:@"SobotCall"];
// Designate bundle name
config.bundleName = @"SobotCall";
// Designate international file path in bundle
config.languageTableName = @"SobotLocalizable";
// Designate international file name
config.languagePathInBundle = @"Localizable";
// Designate color file name in bundle
config.colorTableName = @"SobotColor";
// Designate language
config.absoluetelanguage = @"zh-Hans";
// General API service URL
config.openApiHost = @"https:// api.sobot.com";
// Call API service URL
config.callApiHost = @"https:// openapi.sobot.com";
// Agent signaling service
config.stompSocketUri = @"wss:// openapi.sobot.com/v6.0.0/webmsg/cc-webmsg";
// janus message monitoring service
config.janusSocketUri = @"wss:// rtc.sobot.com.cn/janus";
// janus proxy service
config.sipProxy = @"sip:192.168.30.68:5060";
SobotTMParameter *kitInfo = [[SobotTMParameter alloc]init];
kitInfo.showHomeBack = NO;
[SobotTMApi initWithConfig:config kitInfo:kitInfo result:^(NSInteger code, id _Nullable obj, NSString * _Nullable msg) {
}];
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# ● Permission Setting
Permissions to be added
<key>NSMicrophoneUsageDescription</key>
<String>Making voice calls requires your MIC permission</string>
2
# ● Initiate Sobot Page
# 1. Initiate Call Homepage
Method 1 : Directly use the method we provide to automatically log in and jump to the page. The method is as follows:
/// Initiate SDK and enter the call SDK homepage
/// @param account Account
/// @param loginPwd Password
/// @param vc Initiate VC
/// @param resultBlock Callback result
+(void)startWithAcount:(NSString *)account password:(NSString *)loginPwd viewController:(UIViewController *)vc result:(SobotResultBlock) resultBlock;
/// Add Initiation Page
/// token. Not the accessToken, the URL returned by the account login, the old and new versions will be determined by the system
+(void)startWithToken:(NSString *) token viewController:(UIViewController *) vc result:(SobotTMResultBlock) resultBlock;
2
3
4
5
6
7
8
9
10
11
12
13
Param
Param | Type | Required | Description |
---|---|---|---|
account | NSString | Yes | Agent account |
loginPwd | NSString | Yes | Agent account password |
vc | UIViewController | Yes | VC for executing jump |
resultBlock | Block | No | Execution result, code=1: succeed |
Sample code:
[SobotTMApi startWithAcount:loginAccount password:password viewController:self result:^(NSInteger code, id _Nullable obj, NSString * _Nullable msg) {
}];
2
3
4
Method 2: Directly create SobotCallHomeController, manually log in and jump to the page. You need to log in first and then perform jump operation. The method is as follows:
/// Login
/// @param account Account
/// @param loginPwd Password
/// @param resultBlock Callback result
+(void)loginUser:(NSString *)account password:(NSString * )loginPwd result:(SobotTMResultBlock) resultBlock;
/// Login (with token)
/// @param account Account
/// @param loginPwd Password
/// @param token token
/// @param resultBlock Callback result
+(void)loginUser:(NSString *)account password:(NSString * )loginPwd token:(NSString *) token result:(SobotTMResultBlock) resultBlock;
2
3
4
5
6
7
8
9
10
11
12
13
14
Param
Param | Type | Required | Description |
---|---|---|---|
account | NSString | Yes | Agent account |
loginPwd | NSString | No | Agent account password, used only when token is null |
token | NSString | No | token logged in. Do not set the password when using token; otherwise, you have to log in again and the token will be refreshed |
vc | UIViewController | Yes | VC for executing jump |
resultBlock | Block | No | Execution result, code=1: succeed |
Example:
[SobotTMApi loginUser:fieldUserName.text password:fieldPassword.text token:fieldToken.text result:^(NSInteger code, id _Nullable obj, NSString * _Nullable msg) {
if(code == 1){
// Create VC directly and use at your own discretion
SobotCallHomeController *orderHomeVC = [[SobotCallHomeController alloc]init];
}
}];
2
3
4
5
6
7
8
9
Method 3 : Log in using AppKey and appID, automatically complete the login and redirect to the page:
/// Initiate SDK and enter the call SDK homepage
/// @param account Account
/// @param app_key app_key
/// @param appid appid
/// @param vc Initiate VC
/// @param resultBlock Callback result
+(void)startWithAcount:(NSString *)account appkey:(NSString *)app_key appid:(NSString *) appid viewController:(UIViewController *)vc result:(SobotTMResultBlock) resultBlock;
2
3
4
5
6
7
8
9
10
Param
Param | Type | Required | Description |
---|---|---|---|
account | NSString | Yes | Agent account |
app_key | NSString | Yes | Agent app_key |
appid | NSString | Yes | Agent appid |
vc | UIViewController | Yes | VC for executing jump |
resultBlock | Block | No | Execution result, code=1: succeed |
Sample code:
[SobotTMApi startWithAcount:@"your account" appkey:@"your appkey" appid:@"your appid" viewController:self result:^(NSInteger code, id _Nullable obj, NSString * _Nullable msg) {
}];
2
3
4
5
# ● Login
/// Login
/// @param account Account
/// @param loginPwd Password
/// @param resultBlock Callback result
+(void)loginUser:(NSString *)account password:(NSString * )loginPwd result:(SobotTMResultBlock) resultBlock;
/// Login (with token)
/// @param account Account
/// @param loginPwd Password
/// @param token token
/// @param resultBlock Callback result
+(void)loginUser:(NSString *)account password:(NSString * )loginPwd token:(NSString *) token result:(SobotTMResultBlock) resultBlock;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# ● Logout
/// Exit SDK
/// @param resultBlock Callback result
+(void)outSobotUser:(SobotTMResultBlock) resultBlock;
2
3
4
5
6
# ● Set Debug Mode
/// Set whether it is debug mode, with NO by default and logs not displayed
/// @param isShowDebug YES or NO
+(void)setShowDebug:(BOOL) isShowDebug;
2
3
4
5
6
# Configuration Class Attribute Description
# ● SobotTMParameter Class Description
The configuration takes effect immediately. Configure with the following functions in SobotTMApi.h, and overwrite the previous set value after the initialization and direct configuration;
Param | Type | Required | Description |
---|---|---|---|
showHomeBack | BOOL | No | Whether to display Back button on the homepage, NO (Not display) by default. |
Setting method:
/// Change kitConfig configuration
/// @param kitConfig congfig configuration
+(void)configKitInfo:(SobotTMParameter *) kitConfig;
/// Initialization configuration
/// @param config SobotCallCacheEntity Configuration class, domain name/internationalization/resource
/// @param kitInfo SobotKitConfig configuration class
/// @param resultBlock Initialization callback (NSInteger code,id _Nullable obj,NSString *_Nullable msg);
+(void)initWithConfig:(SobotCallCacheEntity *) config kitInfo:(SobotTMParameter *)kitInfo result:(SobotTMResultBlock) resultBlock;
2
3
4
5
6
7
8
9
10
11
# ● SobotCallCacheEntity Class Description
This attribute must be configured at initialization, and can be configured once without repeating the configuration.
Param | Type | Required | Description |
---|---|---|---|
bundleName | NSString | No | Resource name, SobotOrder by default. |
languagePathInBundle | NSString | No | International file path in bundle, with a fixed value of Localizable. |
languageTableName | NSString | No | International file name in bundle, with a fixed value of SobotLocal. |
colorTableName | NSString | No | Color file name in bundle, with a fixed value of SobotColor. |
absoluetelanguage | NSString | No | Designated language, following the system by default. |
defaultlanguage | NSString | No | Default language when recognition is unavailable, following the system by default. |
openApiHost | NSString | No | Public API domain name. |
callApiHost | NSString | No | Call service domain name. |
stompSocketUri | NSString | No | Agent status monitoring service URL. |
janusSocketUri | NSString | No | janus link service URL. |
sipProxy | NSString | No | janus proxy service URL. |
# Source Code and Demo
Sobot SDK Function DemoDownload (opens new window)
# FAQ
1.Get token?
Please get the login token through the Sobot login API. You should note that the token here is that obtained from development module, not the accessToken of the latest v6 version. In case of failure, you can log in with your username and password. The two methods have exactly the same effect.
Why can't I log in normally?
Before login, please confirm whether to perform the initialization operation, which is a local assignment; there will be no asynchronous requests, and the domain name and basic configuration information will be set. After confirming that the login information is correct, mainly verify whether the domain name fails to match.How to embed the call homepage into other frameworks?
Please refer to the Demo project, which has examples of using tabbar to put the Ticket Center page into it for management.How to monitor call reminder?
Currently there is no message notification for calls. If you need to monitor messages, please check the message monitoring related configuration in SobotCallClient.h.
# Description of Sobot SDK's Collection and Use of Personal Information
Description of Sobot SDK's Collection and Use of Personal Information (opens new window)