- I am not able to get the gender here in
OnCompleted
function - I am able to get other params like
id
,name
,email
- Currently app is in Dev mode
This was working yesterday.
Code:
GraphRequest request = GraphRequest.newMeRequest(
loginResult.getAccessToken(),
new GraphRequest.GraphJSONObjectCallback() {
@Override
public void onCompleted(JSONObject object, GraphResponse response) {
Log.v("LoginActivity", response.toString());
try {
AccessToken token = AccessToken.getCurrentAccessToken();
String accessToken = token.getToken().toString();
String expiresAt = token.getExpires().toString();
String id = object.getString("id");
String gender = object.getString("gender");
} catch (JSONException e) {
e.printStackTrace();
System.out.println(e.toString());
}
}
});
Bundle parameters = new Bundle();
parameters.putString("fields", "id, name, email, gender, location, picture.type(large)");
request.setParameters(parameters);
request.executeAsync();