Closed xiaosan666 closed 7 years ago
目前这个插件有很多项目在使用了,如果换了影响会比较大。
建议fork下来,自己把这个插件换一下。
我使用了另外的插件实现了安装https://github.com/weelion/phonegap-plugin-install
只是需要自己实现下载和下载进度条,下载完成的后的apk用插件安装
大致代码如下: downloadApp() { let alert = this.alertCtrl.create({ title: '下载进度:0%', enableBackdropDismiss: false, buttons: ['后台下载'] }); alert.present();
const fileTransfer: TransferObject = this.transfer.create(); const apk = this.file.externalRootDirectory + 'android.apk'; //apk保存的目录
fileTransfer.download(APP_DOWNLOAD, apk).then(() => { window['install'].install(apk.replace('file://', '')); });
fileTransfer.onProgress((event: ProgressEvent) => { let num = Math.floor(event.loaded / event.total * 100); if (num === 100) { alert.dismiss(); } else { let title = document.getElementsByClassName('alert-title')[0]; title && (title.innerHTML = '下载进度:' + num + '%'); } }); }
在 2017-04-19 12:33:33,"Wen Luo" notifications@github.com 写道:
目前这个插件有很多项目在使用了,如果换了影响会比较大。
建议fork下来,自己把这个插件换一下。
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
I'm going to close this out, it's ok to reopen if the issue still exist.
app有好几个插件依赖这个插件cordova-plugin-app-version(http://ionicframework.com/docs/native/app-version/) 你的这个更新插件有依赖另外一个叫cordova-plugin-appversion的插件,两个插件同时存在会冲突,导致app闪退,能不能把你的依赖改成官方这个