I have integrated facebook login into my app according to the tutorial, but I cant find any good info on how to retrieve the user's email address. The email is really the only thing I need. I am able to get other basic info. My activity extends FaceBookActivity. When the user clicks to log in to my app, I call:
this.openSession();
Then I have:
@Override
protected void onSessionStateChange(SessionState state, Exception exception)
{
// user has either logged in or not ...
if (state.isOpened())
{
// make request to the /me API
Request request = Request.newMeRequest(
this.getSession(),
new Request.GraphUserCallback()
{
// callback after Graph API response with user object
@Override
public void onCompleted(GraphUser user, Response response)
{
if (user != null)
{
TextView welcome = (TextView) findViewById(R.id.welcome);
welcome.setText("Hello " + user.getName() + "!");
Log.d("user fname",user.getFirstName());
Log.d("user lname",user.getLastName());
Log.d("user username",user.getUsername());
Log.d("user email",(String)user.getProperty("email"));
}
}
}
);
Request.executeBatchAsync(request);
}
}
GraphUser does not expose the email. Any ideas?
I have set the 'email' permission in my facebook dev panel.