The new social stuff is AMAZING and works well...until I deploy an update. Steps to reproduce:
$scope.LogoutUser = function() {
console.log("Logging Out User");
$timeout(function () {
$ionicAuth.logout();
$ionicHistory.clearCache();
$ionicHistory.clearHistory();
$scope.LoggedIn = false;
$state.go("signin", { "ActionName": "LoggedOut"});
},300)
}
$scope.hasUpdate = false;
$scope.NoUpdates = false;
var deploy = $ionicDeploy;
// Check Ionic Deploy for new code
$scope.checkForUpdates = function () {
$ionicLoading.show({ template: 'Checking for Updates...', delay: 400 });
$scope.NoUpdates = false;
console.log('Ionic Deploy: Checking for updates');
deploy.check().then(function (hasUpdate) {
console.log('Ionic Deploy: Update available: ' + hasUpdate);
if(hasUpdate) {
$timeout(function(){
$ionicLoading.hide();
$scope.NoUpdates = false;
},2000);
$scope.doUpdate();
}
else {
console.log("No Updates Available");
$timeout(function(){
$ionicLoading.hide();
$scope.NoUpdates = true;
},2000);
}
}, function (err) {
console.error('Ionic Deploy: Unable to check for updates', err);
$timeout(function(){
$ionicLoading.hide();
},2000);
});
}
// Update app code with new release from Ionic Deploy
$scope.doUpdate = function () {
$ionicLoading.show({ template: 'Downloading Updates...', delay: 400 });
console.log("Starting Update...");
deploy.download().then(function (res) {
console.log('Ionic Deploy: Download Success! ', res);
$timeout(function(){
$ionicLoading.hide();
},2000);
$scope.doExtract();
}, function (err) {
$timeout(function(){
$ionicLoading.hide();
},2000);
console.log('Ionic Deploy: Update error! ', err);
}, function (prog) {
$timeout(function(){
$ionicLoading.hide();
},2000);
console.log('Ionic Deploy: Progress... ', prog);
});
};
// Extract the Code so it will be updated on the App next time its launched
$scope.doExtract = function () {
console.log("Starting Extraction...");
$ionicLoading.show({ template: 'Applying Updates...', delay: 400 });
deploy.extract().then(function (res) {
console.log('Ionic Deploy: Extraction Success! ', res);
$timeout(function(){
$ionicLoading.hide();
},2000);
}, function (err) {
console.log('Ionic Deploy: Extraction error! ', err);
$timeout(function(){
$ionicLoading.hide();
},2000);
}, function (prog) {
console.log('Ionic Deploy: Extraction Progress... ', prog);
$timeout(function(){
$ionicLoading.hide();
},2000);
});
};
and here's the login for FB (the twitter one is the same thing, just with "Twitter" in it)
$scope.FacebookLogin = function () {
$ionicAuth.login('facebook').then(function (_info) {
$ionicUser.details.username = $ionicUser.social.facebook.data.full_name;
$ionicUser.details.email = $ionicUser.social.facebook.data.email;
$ionicUser.details.image = $ionicUser.social.facebook.data.raw_data.picture.data.url;
$ionicUser.save();
$scope.loginSuccess();
}, function () {
$scope.signupFailure(_info);
});
};
Facebook does not give me any errors of any kind on the console or network side, but Twitter does have that damn missing cordova browser thing coming up again.