phonegap / phonegap-plugin-contentsync

Download and cache remotely hosted content
Apache License 2.0
206 stars 98 forks source link

### Problems with ContentSync.sync function #bug #195

Open Rafaelferreiraalves opened 6 years ago

Rafaelferreiraalves commented 6 years ago

I have an application that makes use of the plugin. At a certain point I use the ContentSync.sync function to make a call to a web api made in C #. Everything happens perfectly when in the call I put the IP but if I switch to HOSTNAME me the plugin presents errors. Can someone help me ?


function below

function syncApp(localServiceBus, appIndo) { var sync = ContentSync.sync({ src: localServiceBus + 'AppConfigManagerQrcodePage/DownloadApk?zipName=' + appIndo.Download, id: 'appRoot', type: 'replace', validateSrc: false });

sync.on('progress', function (data) { $ionicLoading.show({ template: 'Sincronizando... ' + data.progress + "%" }); });

        sync.on('complete', function (data) {
            console.log(data);
            var applicationDirectory = cordova.file.dataDirectory + 'appRoot';

            localStorageService.setObject("hostConfig", {
                local: false,
                port: "",
                url: applicationDirectory,
                localServiceBus: localServiceBus,
                installApp: false,
                syncApp: true,
                autenticateApp: false,
                appInfo: appIndo
            });

            window.location.href = "index.html";
        });

        sync.on('error', function (e) {
            $ionicLoading.hide();
            toaster.pop('error', '', e);
            console.log(e);
        });

        sync.on('cancel', function () {
            //$ionicLoading.hide();
            //messengerFactory.warning(e)
        });