Hello I’m new to ionic and Angular.js. I’m working on my project which will use login via facebook and login via google+. I registered my app in google.developers and also facebook.developers. I set url to: http://localhost/ and redirect_url: http://localhost/callback But in Facebook when i press button “sign in via facebook” got a facebook forms. So I do insert my email and password. But after that I’ve got error and i’m on facebook page. Error:, The page you requested cannot be displayed at the moment. It may be temporarily unvailable, the link you clicked on may be broken or expired or you may not have permission to view this page."
In google+ I can also see forms and after inserting confirm “offline information”, but after that it freeze!
I’m testing app via ionic view on my iphone5.
Here are codes of both $scope.logins();
$scope.facebookLogin = function() {
$cordovaOauth.facebook("FB_CODE", ["email", "public_profile", "user_friends"]).then(function(result) {
$state.go('main/dash', {}, {reload: true});
$scope.access_token = result.access_token;
//$scope.setCurrentUsername(data.username);
}, function(error) {
var alertPopup = $ionicPopup.alert({
title: 'Login failed!',
template: 'There was a problem signing in!',
buttons:[{
type: 'button-assertive',
text: 'OK!'
}]
});
});
}
$scope.googleLogin = function() {
$cordovaOauth.google(GOOGLE_PLUS_CODE, ["https://www.googleapis.com/auth/urlshortener", "https://www.googleapis.com/auth/userinfo.email"]).then(function(result) {
//console.log("Response Object -> " + JSON.stringify(result));
$state.go('main/dash', {}, {reload: true});
}, function(error) {
var alertPopup = $ionicPopup.alert({
title: 'Login failed!',
template: 'There was a problem signing in!',
buttons:[{
type: 'button-assertive',
text: 'OK!'
}]
});
});
}
Thank you for any helps.
Jamie