Download a file in Andorid Device from Firebase

Hello all

I am trying to download an Image that i have upload in firebase in my android device. I have created two functions dislpay and download. The first one is for displaying the image in my application and the second to donwload the image in my device. The first button works perfectly as i can display the image each time i press it. When i press the download button i get “Download Succeeded the file was successfully downloaded to file:///data/user/0/com.georgepush/filoe/image.jpg” but i cant find my image anywhere in my phone and i dont know if i have succesfully done the function or not. I am pretty new to ionic and mobile development and i really need some guidance

My source code :

import { Component, NgZone } from ‘@angular/core’;

import { NavController, Platform, AlertController } from ‘ionic-angular’;
//import {File,Transfer} from ‘ionic-native’;
import {FileTransferObject } from ‘@ionic-native/file-transfer’;
import {TransferObject} from ‘@ionic-native/transfer’;
import {Transfer} from ‘@ionic-native/transfer’;
import {File} from ‘@ionic-native/file’;

import firebase from ‘firebase’;

declare var cordova: any;

@Component({
selector: ‘storage-home’,
templateUrl: ‘storage.html’,
providers: [Transfer, TransferObject, File]
})

export class StoragePage {

storageDirectory: string = ‘’;
fileTransfer: FileTransferObject;
nativepath: any;
firestore = firebase.storage();
imgsource: any;

constructor(public navCtrl: NavController, public platform: Platform, private transfer: Transfer, private file: File, public alertCtrl: AlertController, public zone: NgZone) {
this.platform.ready().then(() => {
// make sure this is on a device, not an emulation (e.g. chrome tools device mode)
if(!this.platform.is(‘cordova’)) {
return false;
}

  if (this.platform.is('ios')) {
    this.storageDirectory = cordova.file.documentsDirectory;
  }
  else if(this.platform.is('android')) {
    this.storageDirectory = cordova.file.dataDirectory;
  }
  else {
    // exit otherwise, but you could add further types here e.g. Windows
    return false;
  }
});

}

display() {
this.firestore.ref().child(‘image.jpg’).getDownloadURL().then((url) => {
this.zone.run(() => {
this.imgsource = url;
this.fileTransfer.download(url,‘image.jpg’).then((entry) => {
console.log('download complete: ’ + entry.toURL());

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

}

download() {

this.platform.ready().then(() => {

this.firestore.ref().child('image.jpg').getDownloadURL().then((url) => {

this.zone.run(() => {

    const fileTransfer: TransferObject = this.transfer.create();

    const imageLocation = url;

  fileTransfer.download(imageLocation, this.storageDirectory + 'image.jpg').then((entry) => {

    const alertSuccess = this.alertCtrl.create({
      title: `Download Succeeded!`,
      subTitle: `was successfully downloaded to: ${entry.toURL()}`,
      buttons: ['Ok']
    });

    alertSuccess.present();

  }, (error) => {

    const alertFailure = this.alertCtrl.create({
      title: `Download Failed!`,
      subTitle: ` was not successfully downloaded. Error code: ${error.code}`,
      buttons: ['Ok']
    });

    alertFailure.present();

  });

});

})

})

}

}