This topic mainly introduces how to quickly run the Cloud Contact Center uni-app Demo.
Environment Requirements
We recommend using the latest HBuilderX editor.
An iOS device running iOS 9.0 or later and supporting audio.
An Android device running on a version not earlier than 4.1 and supporting audio. Simulators are not currently supported. The option that allows debugging must be enabled.
Your iOS/Android device has been connected to the internet.
Prerequisites
Key Concepts
SdkAppId: The application ID users create on the Cloud Contact Center console. You can create up to 20 Cloud Contact Center applications under one Tencent Cloud account, often starting with 140. UserID: The account configured by the agent or administrator in the Cloud Contact Center, usually in the format of an email address. After the application is created for the first time, the main account can go to Internal Message (sub-account requires a subscription to Cloud Contact Center product messages) to view the contact center administrator account and password. Under one SDKAppID, multiple UserIDs can be configured. If the configuration limit is exceeded, more agents need to be purchased in Agent Purchase. SecretId and SecretKey: A certificate needed by developers to call cloud APIs, created on the Tencent Cloud console. Token: A sign-in ticket, which requires calling the Application Programming Interface CreateSDKLoginToken to access. The correct approach is to place the token calculation code and encryption key on your business server, then the app requests access to the token calculated in real time from your server as needed. Operation Steps
Step 1: Download the tccc-agent-uniapp-example Source Code
Step 2: Install Dependencies
Install npm package dependency.
Install uni-ui. Use HBuilderX to import uni-ui. Step 3: Configure the tccc-agent-uniapp-example Project File
1. Find and open the debug/genTestToken.js file.
2. Set related parameters in the genTestToken.js file:
USERID: Agent account, format: xxx@qq.com
SDKAPPID: Cloud Contact Center SDKAppId, which needs to be replaced with your own account's SDKAppId
SECRETID: The ID of the encryption key used to calculate the signature
SECRETKEY: The key of the encryption key used to calculate the signature
Note:
Please do not publish the following code in the online version of your app. The reasons are as follows:
Although the code in this file can correctly calculate the token, it is only suitable for quickly implementing the basic features of the SDK, but not suitable for online products. This is because the SECRETKEY in the client code is easily decompiled and reverse-engineered, especially in the case of web-based code where the difficulty of cracking is almost negligible. Once your key is leaked, attackers can calculate the correct token to steal your Tencent Cloud traffic.
The correct approach is to place the token calculation code and encryption key on your business server, and the app requests a token calculated in real time from your server when necessary. The cost of cracking the server is higher than the cost of cracking the client app, so the server calculation scheme can better protect your encryption key. For details, refer to Creating SDK Login Token?. Step 4: Compile the Demo
Use Self-Defined Stand Packaging Run (do not choose standard stand run) , and use physical machine run for the self-defined stand.
Step 5: Run the Demo
1. After choosing to run on the physical machine, click Log In.
2. After successfully logging in, enter the phone number you need to dial to use the dial feature.
Execution Effect
The basic features are shown in the figure below:
Exchange and Feedback
Was this page helpful?