更新记录
1.0.3(2025-04-23)
1.0.2(2025-03-30)
1.0.1(2025-03-17)
查看更多
平台兼容性
uni-app
Vue2 |
Vue3 |
Chrome |
Safari |
app-vue |
app-nvue |
Android |
iOS |
鸿蒙 |
√ |
√ |
- |
- |
- |
- |
4.4 |
12 |
- |
微信小程序 |
支付宝小程序 |
抖音小程序 |
百度小程序 |
快手小程序 |
京东小程序 |
鸿蒙元服务 |
QQ小程序 |
飞书小程序 |
快应用-华为 |
快应用-联盟 |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
uni-app x
Chrome |
Safari |
Android |
iOS |
鸿蒙 |
微信小程序 |
- |
- |
5.0 |
12 |
- |
- |
操作步骤
- 1.根目录添加如下
AndroidManifest.xml
文件
- 2.将里面的所有
你的包名
改为你的真实包名
- 3.引入在你会被编译的
uvue
或uts
文件内
- 4.然后打包自定义基座
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"
package="你的包名">
<application>
<activity
android:name="你的包名.FaceVerifyDemoActivity"
android:configChanges="orientation"
android:exported="true"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:exported="true" android:name="你的包名.SettingActivity"></activity>
<activity android:exported="true" android:name="你的包名.FaceResultActivity"></activity>
</application>
</manifest>
暴露的interface
export type xFacialcorebodySuccess = {
code: number
msg: string
data?: any
}
export type xFacialcorebodyError = {
errCode: number
}
export type xFacialcorebodyOptions = {
faceId?: string
agreementNo?: string
openApiAppId?: string
openApiAppVersion?: string
openApiNonce?: string
openApiUserId?: string
openApiSign?: string
verifyMode?: number
keyLicence?: string
success?: (res: xFacialcorebodySuccess) => void
fail?: (res: xFacialcorebodyError) => void
}
示例代码
<script setup>
import {xOnFacial,xFacialcorebodySuccess,xFacialcorebodyError} from "@/uni_modules/x-facialcorebody-s"
function handleValidate(){
xOnFacial({
faceId: "",
agreementNo:"",
openApiAppId:"",
openApiAppVersion:"",
openApiNonce:"",
openApiUserId:"",
openApiSign:"",
verifyMode:"",
keyLicence:"",
success: (result: xFacialcorebodySuccess) => {},
fail: (result: xFacialcorebodyError) => {},
} as xFacialcorebodyOptions)
}
</script>