I am using ngOpenFB on an ionic app, but I dont manage to get user's email

71 views Asked by At

Login seems to go ok, with the email permission,

however when doing:

var deferred = $q.defer(); $openFB.api({ path: '/me/email'

  }).then(function( res ) {
    deferred.resolve(res);
    //angular.extend(me, {picture: res.data.url});
  }).catch(function(err){
    console.log(err);
    deferred.reject(err);
  });

I get an error wrong path.

Ben

1

There are 1 answers

0
andyrandy On

/me/email is not a valid endpoint. This is how you get the email of a user: /me?fields=email

The error (from the API Explorer):

{
  "error": {
    "message": "Unknown path components: /email",
    "type": "OAuthException",
    "code": 2500,
    "fbtrace_id": "FBdZx0Yntxz"
  }
}