I tested your workaround and it solved this issue. Unfortunately I have now two other issues.
The first one affects the fileTransfer API. On start up the app downloads some logos, which fails randomly. Sometimes the download of the logos works and sometime it fails. When it fails I get the following output from Visual Studio:
ERROR: Exception in ProcessCommand :: Exception has been thrown by the target of an invocation.
ERROR: failed to InvokeMethodNamed :: download on Object :: FileTransfer
The error callback gets called and outputs the following:
Error while downloading logos: {"code":null,"source":null,"target":null,"http_status":null,"body":null}
The code which produces the error:
code
my.downloadLogos = function(filenames) {
logoDownloadError = false;
numberOfLogoDownloads = 0;
numberOfLogos = filenames.length;
requestFileSystem(LocalFileSystem.PERSISTENT, 0, function(fs) {
fs.root.getDirectory("BonusPlus/Logos", {
create: true,
exclusive: false
}, function(entry) {
localStorage.setItem('logoPaths', JSON.stringify(logoPaths));
for (var i = 0; i < filenames.length; i++) {
var url = LogoURL + filenames.Filename;
var path = fs.root.fullPath + "/BonusPlus/Logos/" + filenames.LogoID;
var fileTransfer = new FileTransfer();
fileTransfer.download(url, path, downloadSuccess, downloadError);
}
}, function(evt) {
console.log("FileSystem failure: " + evt.code);
});
}, function(evt) {
console.log("FileSystem failure: " + evt.code);
});
};
/code
The second issue I have, is that the onload method for each page is only called once, this is most likely the outcome of changing the app to the multi-page template. So is there an easy way to change the behavior or do I need to go through every page and change the code?
I have uploaded the project to Dropbox, so you don't need to add the database plugin. You can find the "fileTransfer-code" in the www/views/assets/js/DataCollector.js file.
https://www.dropbox.com/sh/bewlj4vkdc...