Tencent Cloud Desk Customer UIKit is a UIKit Framework for integrating AI-powered customer service chat on the customer side of Tencent Cloud Desk, providing efficient and seamless communication with both AI and human agents.
Follow the steps below to integrate and use the framework.
To integrate TencentCloudAIDeskCustomer into your project, add the following line to your Podfile:
pod 'TencentCloudAIDeskCustomer'
Then, run the following command to install the pod:
pod install
Before using the customer service feature, you need to log in and set the customer service user ID. You can do this at any point before initiating a customer service chat.
Add the following code at the appropriate point in your app’s lifecycle:
- (void)login:(NSString *)userID userSig:(NSString *)sig {
[[TencentCloudCustomerManager sharedManager] loginWithSdkAppID:public_SDKAPPID userID:userID userSig:sig completion:^(NSError *error) {
if (!error) {
// Set customer service user ID after login
[[TencentCloudCustomerManager sharedManager] setCustomerServiceUserID:CUSTOMER_SERVICE_USER_ID];
}
}];
}
You can find more details about generating a UserSig in this documentation.
Once you have logged in and set the customer service user ID, you can easily open the customer service page from any view controller.
Here’s an example of how to add a button to open the customer service chat:
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Create a button to start customer service chat
UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem];
[button setTitle:@"Customer Service" forState:UIControlStateNormal];
[button addTarget:self action:@selector(chatButtonTapped) forControlEvents:UIControlEventTouchUpInside];
[button sizeToFit];
button.center = self.view.center;
[self.view addSubview:button];
}
// Action to initiate the customer service chat
- (void)chatButtonTapped {
[[TencentCloudCustomerManager sharedManager] pushToCustomerServiceViewControllerFromController:self];
}
@end
userID and UserSig, then set the CUSTOMER_SERVICE_USER_ID.pushToCustomerServiceViewControllerFromController:.For comprehensive documentation, visit the Tencent Cloud Desk Documentation.