markmarijnissen / cordova-app-loader

Remote update your Cordova app
http://data.madebymark.nl/cordova-app-loader/index.html
644 stars 128 forks source link

Update doesn't work on Android (check and download is ok) [ionic] #96

Open przygrubyu5 opened 8 years ago

przygrubyu5 commented 8 years ago

Hi @markmarijnissen

  1. Android devices -HTC One X
  2. Chrome is working, but had error, I understand image

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();
    }
});

};

img_0761

img_0760

  1. login.html in manifest.json
  2. I change login.js and update manifest on serve

Please hele me!

markmarijnissen commented 8 years ago

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:

przygrubyu5 commented 8 years ago

use ionic and google Chrome and Sublime, not use IDE.

przygrubyu5 commented 8 years ago

image

image