vi_shop
vi_shop

Reputation: 11

Download pdf file from firebase storage ioinc 5

I am trying to download pdf file in ionic 5 application, which is stored in firebase storage i tried using filetransfer but file not downloading in my device it gives entry url this

file:///data/user/0/io.ionic.starter/files/test.pdf

Here the Download function

download(downloadUrl: string) {
  console.log(downloadUrl);

   this.fileTransfer.download(downloadUrl,this.file.dataDirectory +'test.pdf').then((entry) => {
    console.log('download complete: ' + entry.toURL());

    }, (error) => {
  
    });
    
  }

Upvotes: 0

Views: 469

Answers (1)

Paresh Gami
Paresh Gami

Reputation: 4782

You need to add

android:requestLegacyExternalStorage="true"

inside AndroidMenifest.xml > application tag like below screenshot. It's required to add in the android 11 version.

enter image description here

Upvotes: 1

Related Questions