npm uninstall uclean-app-update-plugin
npm install uclean-app-update-plugin
在android/app/src/main/java/com/ujing/franchisee/MainActivity.java 的init方法中增加 add( UcleanQRCodePlugin.class );
this.init(savedInstanceState, new ArrayList<Class<? extends Plugin>>() {{
// Additional plugins you've installed go here
// Ex: add(TotallyAwesomePlugin.class);
add( UcleanAppUpdatePlugin.class );
}});
const { UcleanAppUpdatePlugin } = Capacitor.Plugins;
const result = await UcleanAppUpdatePlugin.updateApp({url: string});
{
url: string, // apk下载地址 或者 appstore url必填
}
{
errorCode: string,
errorMessage: string,
}
const { UcleanAppUpdatePlugin } = Capacitor.Plugins;
const result = await UcleanAppUpdatePlugin.checkAppUpdate({version: string, url: string, apkName: string, skipPromptDialog: boolean, skipProgressDialog: boolean});
{
version: string, // app远程版本号 必填
url: string, // apk下载地址 必填
apkName: string, // apk保存的名字 非必填
skipPromptDialog: boolean, // 是否跳过提示对话框 非必填
skipProgressDialog: boolean, // 是否跳过下载对话框 非必填
}
{
errorCode: string,
errorMessage: string,
}