未打开文件是成功回调离子文件打开器

时间:2019-06-07 05:13:04

标签: ionic-framework ionic4 ionic-native

我下载了apk文件并打开下载的文件

const fileTransfer: FileTransferObject = this.transfer.create();
const url = data;
console.log(this.file, 'files');
fileTransfer.download(url, this.file.externalDataDirectory + 'b2taxi.apk').then((entry) => {
  console.log(entry, entry.toURL());
  this.fileopener.open(entry.toURL(), 'application/vnd.android.package-archive').then(() => {

    console.log('file opened');
  }, err => {
    console.log('error open file: ', err);
  });
}, (error) => {
  console.log(error, 'error');
});

回调返回成功,但文件未打开。在离子4

0 个答案:

没有答案