I want to download files from the server and store it on the installed drive applications like iCloud, Google Drive etc on my iPhone. I’m using Ionic 3 and Cordova 8.I’m using cordova-file-transfer plugin for downloading. Below is the target path which I have given for downloading the files.
cordova.file.syncedDataDirectory + filename;
But the file is getting downloaded into app’s sandbox storage. User can access it only via iTunes data sharing(By connecting iPhone to mac machine).But I want to save the files into drive applications(how popular apps like whatsapp, facebook, skype does) so that user can view it without connecting device to mac machine. Below is my complete code.
var targetPath = cordova.file.syncedDataDirectory;
const fileTransfer: FileTransferObject = this.transfer.create();
this.base.showLoadingPopUp();
fileTransfer.download(URL,targetPath+attachment,true)
.then((entry) => {
this.message= 'Download Completed' + entry.toURL();
}).catch(e => {
console.log('Download Fail: ' + e);
})
Any help would be appreciated, thanks in advance.