Where is problem??
I am calling it within app.component.ts. Also tried home.ts. Everytime crash app. There are 1200 pages and return json for every page. I have tried android:largeHeap=“true”
getAllData() {
let fileTransfer: FileTransferObject = this.transfer.create();
for (var i = 1; i < 1200; i++) {
let url = encodeURI('Here is API URL' + i + '/G');
fileTransfer.download(url, this.file.dataDirectory + 'G' + i + '.json').then((entry) => {
// Nothing comes here....
}, (error) => {
// handle error
});
}
}
@Amara, hello, I see you suggest onProgress function, I just want to ask if you can make “onPregress” function work with IOS ? for me onProgress work only Android
This design seems nuts to me. Instead of 1200 network requests on every app launch, why not package everything into a single JSON object and either save it to Ionic Storage or embed it into the app binary?