uni.installApk(options)
安装apk
本 API 是 uni ext api,需下载插件:uni-installApk
Parameters
InstallApkOptions Values
name | type | optinal | default | description |
filePath | string | YES | - | apk文件地址 |
success | (res: InstallApkSuccess) => void | NO | null | 接口调用成功的回调函数 |
fail | (err: InstallApkFail) => void | NO | null | 接口调用失败的回调函数 |
complete | (res: any) => void | NO | null | 接口调用结束的回调函数(调用成功、失败都会执行) |
InstallApkSuccess Values
name | type | optinal | default | description |
errMsg | string | YES | - | 安装成功消息 |
InstallApkFail Values
name | type | optinal | default | description |
errCode | number | YES | - | 错误码 - 1300002 找不到文件 |
installApk Compatibility
Android version | Android uni-app | Android uni-app-x | iOS version | iOS uni-app | iOS uni-app-x |
4.4 | 3.94+ | 3.94+ | x | x | x |
See also
Related Bug
Example
hello uni-app x
General type
GeneralCallbackResult
name | type | optinal | default | description |
errMsg | string | YES | - | 错误信息 |