未找到Ionic native file opener 2错误类

时间:2017-08-16 10:46:05

标签: ionic-framework ionic2 cordova-plugins ionic3 ionic-native

尝试打开文件Class not found

时收到错误消息

.ts

open(){
  this.platform.ready().then(() => {
   this.fileOpener.open(this.entry.nativeURL, this.attachment.mime).then(() => {
    console.log('file opened')
   }, err => {
    console.log('error open file: ', err)
  });
 });
}

this.entry.nativeURL是使用File Transfer

的下载结果

nativeURL:file:///storage/emulated/0/Download/someFile.docx

this.fileTransfer.download(url, this.storageDirectory + this.attachment.fileName, trustAllHosts).then((entry) => {
 console.log('entry: ', entry);
 this.entry = entry;
}

this.attachment.mime:application/vnd.openxmlformats-officedocument.wordprocessingml.document

我还尝试application/pdf获取pdf文件,但无效

1 个答案:

答案 0 :(得分:2)

它的工作......问题出在运行app --livereload