Hi I'm playing with new Facebook Android SDK. One thing I could not figure out is how can I ask for email address. I tried following but it returned values for all fields except email address. I guess I probably have to ask permission separately for email address but not sure how I can do that if I use LoginFragment.
Request request = Request.newMeRequest(session, new GraphUserCallback() {
@Override
public void onCompleted(GraphUser user, Response response) {
profilePictureView.setUserId(user.getId());
userNameView.setText(user.getName());
}
});
String NAME = "name";
String ID = "id";
String PICTURE = "picture";
String EMAIL = "email";
String FIELDS = "fields";
String REQUEST_FIELDS = TextUtils.join(",", new String[] {
ID, NAME, PICTURE, EMAIL
});
Bundle parameters = new Bundle();
parameters.putString(FIELDS, REQUEST_FIELDS);
request.setParameters(parameters);
Request.executeBatchAsync(request);
Any help is appreciated. Thanks