I’m trying to setup the ionicDeploy for hot code push but I’m having trouble getting it to run.
In terminal I ran:
$ ionic add ionic-service-deploy
In the index I took out cordova.js:
<script src="lib/ngCordova/dist/ng-cordova.js"></script>
<!-- <script src="cordova.js"></script> -->
in Javascript I have:
.run(function($ionicDeploy, $rootScope, $http, $ionicPopup, $ionicPlatform,
$cordovaNetwork, userService) {
$ionicDeploy.check().then(function (response) {
if (response) {
// Download the updates
$ionicDeploy.download().then(function() {
// Extract the updates
$ionicDeploy.extract().then(function() {
// Load the updated version
$ionicDeploy.load();
}, function(error) {
// Error extracting
}, function(progress) {
// Do something with the zip extraction progress
$scope.extraction_progress = progress;
});
}, function(error) {
// Error downloading the updates
}, function(progress) {
// Do something with the download progress
$scope.download_progress = progress;
});
} else {
// No updates, load the most up to date version of the app
$ionicDeploy.load();
}
},
function(error) {
console.error("ionicdeploy error", error);
// userService.customAlert("Update Error", JSON.stringify(error));
});
})