iOS

最近更新时间:2024-09-06 15:18:51

我的收藏

介绍

专为客服场景定制的 Customer UIKit,提供针对性强的用户侧客服会话界面,满足客服场景需求。UI、交互及功能体验,均面向智能客服场景设计。
此外, Customer UIKit 让集成客服模块省去集成 IM,只需要简短的若干行代码,即可完成开发。

前提条件

了解在线客服相关术语及相关配置,并已完成以下步骤:添加客服、配置技能组、创建会话服务流,详情请参见 快速入门

功能展示



快速集成

环境与版本

iOS 版本: iOS 11 以上。
支持模拟器调试及真机运行。

集成包

在 XCode 工程中, 通过 Cocoapods 集成 TencentCloudCustomer。
在 Podfile 中, 添加如下示例代码:
target 'MyApp' do
pod 'TencentCloudCustomer'
end

登录与初始化

调用 loginWithSdkAppID 方法完成 UIKit 登录,并调用 setCustomerServiceUserID 设置在线客服的 UserID,示例代码如下:
#import "TencentCloudCustomer/TencentCloudCustomerManager.h"

- (void)login:(NSString *)userID userSig:(NSString *)sig {
[[TencentCloudCustomerManager sharedManager] loginWithSdkAppID:"应用的 SDKAppID" userID:"当前登录用户的UserID" userSig:"当前登录用户的UserSig" completion:^(NSError *error) {
[[TencentCloudCustomerManager sharedManager] setCustomerServiceUserID: "控制台上获得的在线客服 UserID"];
}];
}

打开客服聊天页

调用 pushToCustomerServiceViewControllerFromController 方法,跳转至客服聊天页面。
#import <TencentCloudCustomer/TencentCloudCustomerManager.h>

[[TencentCloudCustomerManager sharedManager] pushToCustomerServiceViewControllerFromController:self];
至此,在线客服功能在 iOS 端集成完成。

高级用法

如果需要更多高级能力,可参考使用如下高级 API 能力。

设置页面风格

可选 Light 主题和 Dark 主题,分别对应 @"customer_light" 和 @"customer_dark"。
[[TencentCloudCustomerManager sharedManager] applyTheme:<#(NSString *)#>];

设置快捷用语

设置输入框上部快捷用语。
[[TencentCloudCustomerManager sharedManager] setQuickMessages:<#(NSArray<TUICustomerServicePluginMenuCellData *> *)#>];