I've got this code (which was working in 11/2014) called from a button click:
Session.openActiveSession(this, true, new Session.StatusCallback() {
@Override
public void call(Session session, SessionState state, Exception exception) {
if (session.isOpened()) {
Request.newMeRequest(session, new Request.GraphUserCallback() {
@Override
public void onCompleted(final GraphUser user, final Response response) {
if (user != null) {
System.out.println(user);
preference.edit().putString("fb_nome",user.getName()).commit();
preference.edit().putString("fb_id",user.getId()).commit();
preference.edit().putString("fb_email",user.asMap().get("email")+"").commit();
if(user.getLocation()!=null) {
preference.edit().putString("fb_citta", user.getLocation().asMap().get("name") + "").commit();
}
Session session = Session.getActiveSession();
preference.edit().putString("fb_token",session.getAccessToken()).commit();
new loginFacebook().execute();
}
}
}).executeAsync();
}
}
});
latest sdk and so on.
the problem is that facebook doesn't give me the email and the city anymore!
i'm sure it was working on 11/2014, but now no.
email is null and also the city...
someone can help me? thanks