You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am having trouble getting this to work and could use some advice on how to debug.
I've just knocked up a tiny simple app.js that does a check(), update(), download(), but it seems that check() never resolves on Android. Running directly in Chrome on desktop everything works as expected.
At the moment I'm just using the prebundled cordova-app-loader-complete.js. There's a call to
It seems that the self.cache.list() never resolves on Android.
What really confuses me is that nothing is showing up on the server log, even though the cordova app seems to be making successful XHR requests for manifest.json???
In case it helps, my app.js looks like this:
// Initialize a FileSystem
var fs = new CordovaPromiseFS({
Promise: Promise
});
// Initialize a CordovaAppLoader
var loader = new CordovaAppLoader({
fs: fs,
serverRoot: 'http://custard:7771/',
localRoot: 'app',
cacheBuster: true, // make sure we're not downloading cached files.
checkTimeout: 1000 // timeout for the "check" function - when you loose internet connection
});
document.body.innerHTML = '<div id="text"></div><div id="status"></div><button id="checkButton">Check</button><button id="updateButton">Update</button>';
document.getElementById('text').innerHTML = 'hello world 4';
setStatus('initial');
function setStatus(text) {
document.getElementById('status').innerHTML = text;
console.log('setStatus: ' + text);
}
function doCheck() {
setStatus('checking');
// download manifest from: serverRoot+'manifest.json'
loader.check().then(function(updateAvailable) {
if (updateAvailable) {
setStatus('update available');
} else {
setStatus('no update available');
}
}, function (err) {
setStatus('check failed');
console.log('Failed to check: ' + err);
});
}
function doUpdate() {
setStatus('updating');
function onProgress(progress) {
setStatus('progress: ' + progress);
}
loader.download(onProgress).then(function (mainfest) {
setStatus('download complete');
loader.update();
}, function (failedFiles) {
setStatus('failed to download: ' + failedFiles.join(', '));
});
}
document.getElementById('checkButton').addEventListener('click', doCheck);
document.getElementById('updateButton').addEventListener('click', doUpdate);
window.BOOTSTRAP_OK = true;
If anyone could give some tips on what to look for I would really appreciate it!
Thanks.
The text was updated successfully, but these errors were encountered:
However, that still doesn't explain why the promise was never resolved. I would have expected it to reject with an error instead of hanging forever. Is there something that can be done about this?
SystemParadox
changed the title
Check never resolves on Android
check() never resolves if cordova-plugin-file is missing
May 11, 2016
I am having trouble getting this to work and could use some advice on how to debug.
I've just knocked up a tiny simple app.js that does a
check()
,update()
,download()
, but it seems thatcheck()
never resolves on Android. Running directly in Chrome on desktop everything works as expected.At the moment I'm just using the prebundled
cordova-app-loader-complete.js
. There's a call toIt seems that the
self.cache.list()
never resolves on Android.What really confuses me is that nothing is showing up on the server log, even though the cordova app seems to be making successful XHR requests for manifest.json???
In case it helps, my app.js looks like this:
If anyone could give some tips on what to look for I would really appreciate it!
Thanks.
The text was updated successfully, but these errors were encountered: