Hi
i use Native File Transfer for Downloading Files from Wordpress. its work like charm in android BUT in IOS not work
i use xcode for emulate and Build app in Mac. when i test app in simulation of xcode File Transfer Work but when Build App for IOS its not working (other things work).
also i test other storage place like appdirectory and … reference and remove and reinstall file transfer plugin but not solve the problem
download.ts
(download is a component not page)
download_song() {
this.plt.ready().then(() => {
let path = null;
if (this.plt.is('ios')) {
path = this.file.cacheDirectory;
} else if (this.plt.is('android')) {
path = this.file.externalDataDirectory;
}
if (this.playlist_select!=null && this.playlist_select!= undefined ) {
this.is_download = true;
this.file_transfer = this.transfer.create();
this.file_transfer.download(this.select_url, path + this.post.id + '.mp3').then((entry) => {
this.download_song_addList();
}, (error) => {
this.viewCtrl.dismiss();
});
this.img_transfer = this.transfer.create();
this.img_transfer.download(this.post.img, path + this.post.id + '.jpg').then((entry) => {
}, (error) => {
});
this.file_transfer.onProgress((progressEvent) => {
this._zone.run(() => {
this.dl_loaded = this.formatBytes(progressEvent.loaded);
this.dl_total = this.formatBytes(progressEvent.total);
this.dl_total_byet = progressEvent.total;
this.dl_loaded_byet = progressEvent.loaded;
if (progressEvent.lengthComputable) {
var perc = Math.floor(progressEvent.loaded / progressEvent.total * 100);
}
});
});
}else {
this.presentPrompt();
}
});
}
also i use safari to debug and find error but in simulation isn’t any error.
My Project Info :
Thanks.