cordova-app-loader
cordova-app-loader copied to clipboard
Update doesn't work on Android (check and download is ok) [ionic]
Hi @markmarijnissen
- Android devices -HTC One X
- Chrome is working, but had error, I understand
3.Android check and download ok, but not update
[ionic] code in loginController $scope.checkUpdate = function () { var fs = new CordovaPromiseFS({ persistent: typeof $window.cordova !== 'undefined', Promise: $q });
// Initialize a CordovaAppLoader
var loader = new CordovaAppLoader({
fs: fs,
serverRoot: $rootScope.baseSourceUrl + '/pcberpapp/www/',
localRoot: 'app',
cacheBuster: true, // make sure we're not downloading cached files.
checkTimeout: 10000 // timeout for the "check" function - when you loose internet connection
});
loader.check().then(function (updateAvailable) {
if (updateAvailable)
{
loader.download(onProgress)
.then(
function (manifest)
{
console.log(manifest);
loader.update();
$scope.doLogin();
},
function (failedDownloadUrlArray)
{
console.log(failedDownloadUrlArray);
}
)
}else {
$scope.doLogin();
}
});
};
- login.html in manifest.json
- I change login.js and update manifest on serve
Please hele me!
Strange. I need console logs of the device to debug the error.
Connect your device in debugging mode, install a debug-version of the app, and then goto chrome://inspect to checkout your logs.
Or if you use an IDE for android apps, you could see logs there.
I would check:
- After reload, is manifest.json updated? Particulary, is the Manifest.root configured?
use ionic and google Chrome and Sublime, not use IDE.