This is my function that I get the profile info of user:
function facebookLogin() {
return $q(function(resolve, reject) {
$cordovaOauth.facebook('CLIENT_ID', ['id', 'email', 'name', 'age_range', 'gender', 'user_photos', 'user_work_history', 'user_friends']).then(function(result) {
$localStorage.facebookToken = result.access_token
$http.get('https://graph.facebook.com/v2.8/me', { params: { access_token: $localStorage.accessToken, fields: 'id, name, email, gender, picture', format: "json" } }).then(function(profile) {
alert(JSON.stringify(profile.data))
resolve(true)
}, function(err) {
console.log(err)
})
}, function(err) {
alert('Erro login: ' + JSON.stringify(err))
})
})
}
In the first function facebook, facebook renders a window and then the user logs in, but I always get this screen, it says: 'Something went wrong, We're working to fix this as soon as possible':
If I i quit this window then the catch error is called and I get "The sign flow was canceled", any ideas?
It was a problem with permissions when i call facebook screen