ts file
import { FileTransfer, FileTransferObject } from '@ionic-native/file-transfer';
import { File } from '@ionic-native/file';
export class SessionDetail {
constructor(
private transfer: FileTransfer,
private file: File,
){}
download(fileUrl:any) {
const fileTransfer: FileTransferObject = this.transfer.create();
const url = fileUrl; // http://domain.com/file.pdf
fileTransfer.download(url,this.file.dataDirectory).then((entry) => {
console.log('download complete:url ' + entry.toURL());
}, (error) => {
});
}
}
No error shows. I was tried in android device. I am missing something…