Appearance
腾讯 SDK 相关功能接口
介绍
腾讯三方 SDK 功能罗列
目录
OCR 识别
接口名称
startOCR
示例代码
js
cordova.exec(
(success) => {
console.log("成功的回调函数");
console.log(success);
},
(err) => {
console.log("失败的回调函数_", err);
},
"TrinaPlugin",
"startOCR",
[
{
orderNo: "2020123123456789",
appId: "123456789",
appVersion: "1.0.0",
nonce: "123456789",
userId: "123456789",
sign: "2020123123456789",
},
]
);
API
入参
| 参数 | 必传 | 类型 | 说明 |
|---|---|---|---|
| orderNo | 是 | string | 订单号 |
| appId | 是 | string | appId |
| appVersion | 是 | string | appVersion |
| nonce | 是 | string | 随机数 |
| userId | 是 | string | 用户 id |
| sign | 是 | string | 签名 |
出参
- 成功返回 JSON 数据
| 参数 | 类型 | 说明 |
|---|---|---|
| name | string | 用户名 |
| cardNum | string | 身份证 |
- 失败返回:
string文本说明
人脸核身
接口名称
startFaceVerify
示例代码
js
cordova.exec(
(success) => {
console.log("成功的回调函数");
console.log(success);
},
(err) => {
console.log("失败的回调函数_", err);
},
"TrinaPlugin",
"startFaceVerify",
[
{
faceId: "2020123123456789",
orderNo: "2020123123456789",
appId: "2020123123456789",
appVersion: "2020123123456789",
nonce: "2020123123456789",
userId: "2020123123456789",
sign: "2020123123456789",
keyLicence: "2020123123456789",
},
]
);
API
入参
| 参数 | 必传 | 类型 | 说明 |
|---|---|---|---|
| faceId | 是 | string | 人脸 ID |
| orderNo | 是 | string | 订单号 |
| appId | 是 | string | appId |
| appVersion | 是 | string | appVersion |
| nonce | 是 | string | 随机数 |
| userId | 是 | string | 用户 id |
| sign | 是 | string | 签名 |
| keyLicence | 是 | string | 密钥 |
出参
成功返回
string文本说明失败返回:
string文本说明
上传腾讯云 COS
接口名称
uploadTensentCOS
示例代码
js
window.cordova.exec(
(data) => {
console.log("成功", data);
},
(err) => {
console.log("失败", err);
},
"TrinaPlugin",
"uploadTensentCOS",
[
{
fileName: "test.txt",
filePath: "file:///storage/emulated/0/Download/test.txt",
secretId: "AKIDxxxxxxxxxxxxxxxxxx",
secretKey: "xxxxxxxxxxxxxxxxxxxxx",
sessionToken: "xxxxxxxxxxxxxxx",
startTime: 1620000000,
expiredTime: 1620000000,
region: "ap-guangzhou",
bucket: "test-1250000000",
expiration: 1620000000,
connectionTimeout: 15000,
socketTimeout: 30000,
},
]
);
API
入参
| 参数 | 必传 | 说明 | 类型 | 默认值 |
|---|---|---|---|---|
| fileName | 是 | string | 文件名 | |
| filePath | 是 | string | 文件路径 | |
| secretId | 是 | string | secretId | |
| secretKey | 是 | string | secretKey | |
| sessionToken | 是 | string | sessionToken | |
| startTime | 是 | long | 签名开始时间 | |
| expiredTime | 是 | long | 签名过期时间 | |
| region | 是 | string | 地域 | |
| connectionTimeout | 是 | long | 连接超时时间 | |
| socketTimeout | 是 | long | 读超时 |
出参
- 成功返回 JSON 数据
| 参数 | 类型 | 说明 |
|---|---|---|
| complete | boolean | 上传是否完成:true 完成 false 上传中 |
| currentSize | int | 当前上传大小 |
| totalSize | int | 总的大小 |
| fileUrl | string | 公开访问 URL |
- 失败返回:
string文本说明
取消 COS 上传
接口名称
cancelUploadTensentCOS
示例代码
js
window.cordova.exec(
(data) => {
console.log("成功", data);
},
(err) => {
console.log("失败", err);
},
"TrinaPlugin",
"cancelUploadTensentCOS",
[]
);
API
入参
| 参数 | 必传 | 说明 | 类型 | 默认值 |
|---|
出参
| 参数 | 类型 | 说明 |
|---|