0.0.20 • Published 3 years ago

uclean-hot-code-push-plugin v0.0.20

Weekly downloads
1
License
MIT
Repository
-
Last release
3 years ago

插件安装与卸载

卸载插件

npm uninstall uclean-hot-code-push-plugin

安装插件

npm install uclean-hot-code-push-plugin

在android/app/src/main/java/com/ujing/franchisee/MainActivity.java 的init方法中增加 add( UcleanHotUpdatePlugin.class );

this.init(savedInstanceState, new ArrayList<Class<? extends Plugin>>() {{
  // Additional plugins you've installed go here
  // Ex: add(TotallyAwesomePlugin.class);
  add( UcleanHotUpdatePlugin.class );
}});

js调用方法

初始化热更插件,判断是读取程序内文件还是SD卡/沙盒内文件

const { UcleanHotUpdatePlugin } = Capacitor.Plugins;
const result = await UcleanHotUpdatePlugin.initJSResource();
返回值格式
{
  errorCode: string,
  errorMessage: string,
}

下载JS文件

const { UcleanHotUpdatePlugin } = Capacitor.Plugins;
const result = await UcleanHotUpdatePlugin.downloadJSFile({ url: string });
参数
{
  url: string, // 文件下载路径
}
返回值格式
{
  errorCode: string, // '0'下载完成,其他下载失败
  errorMessage: string
  }

监听下载进度变化

const { UcleanHotUpdatePlugin } = Capacitor.Plugins; const progressListener = UcleanHotUpdatePlugin.addListener('progressDidChanged',(result) => { //progress:result.progress })

移除监听方法

progressListener.remove()

result返回值格式
{
   progress: Int
}

覆盖安装旧版本

const { UcleanHotUpdatePlugin } = Capacitor.Plugins;
const result = await UcleanHotUpdatePlugin.installJSFile();
返回值格式
{
  errorCode: string,
  errorMessage: string,
}
0.0.20

3 years ago

0.0.16

3 years ago

0.0.17

3 years ago

0.0.18

3 years ago

0.0.19

3 years ago

0.0.14

4 years ago

0.0.15

4 years ago

0.0.12

4 years ago

0.0.13

4 years ago

0.0.10

4 years ago

0.0.11

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.2

5 years ago