pwlin / cordova-plugin-file-opener2

A File Opener Plugin for Cordova
MIT License
314 stars 587 forks source link

pdf not opening on deployed app #226

Closed ndar0430 closed 5 years ago

ndar0430 commented 6 years ago

the plugin is working fine on APK (ionic cordova run android --device) but not in my deployed app on google playstore. (im using vsts to build my cordova)

cordova version: 6.3.1..

and also i'm wondering why my APK app has a storage permission and my deployed app doesnt have

var base64 = this.siteProfile.SLA;
    let downloadPDF: any = base64
    fetch('data:application/pdf;base64,' + downloadPDF, {
      method: "GET"
    }).then(res => res.blob()).then(blob => {
      this.file.writeFile(this.file.externalApplicationStorageDirectory, 'statement.pdf', blob, {
        replace: true
      }).then(res => {
        this.fileOpener.open(
          res.toInternalURL(),
          'application/pdf'
        ).then((res) => {

        }).catch(err => {
          console.log('open error')
        });
      }).catch(err => {
        console.log('save error')
      });
    }).catch(err => {
      console.log('error')
    });
shnist commented 5 years ago

hi @ndar0430, thanks for raising this issue. There have been some fixes for android which were released in the new version 2.1.0. Could you try using the latest version to see if that resolves your issue?

shnist commented 5 years ago

Closing this issue due to inactivity. Feel free to reopen if you still require assistance.