nraboy / ng-cordova-oauth

AngularJS oauth library for use with Apache Cordova projects
https://www.thepolyglotdeveloper.com
MIT License
456 stars 199 forks source link

Facebook OAuth Internal facebook problem #305

Closed fzamperin closed 7 years ago

fzamperin commented 7 years ago

Hi I'm having a problem that I just can't get rid of, it seems some facebook error, this is my code that I use to login and then get the profile info of the 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))
        })
      })
    }

I get this message error from facebook when it will render the login part and permissions for the user: "Something went wrong, We're working to get this fixed", don't know why. Sorry if it's not ng-cordova-oauth problem but stackoverflow didn't help me at all, thanks in advance.

fzamperin commented 7 years ago

Actually I was having problems with permissions in facebook which give a strange error, sorry for the inconvinience.