I am trying to get education detail and work description of user from facebook. I login successfully and get Access token. But I am unable to get details I want
Code I am using for it :-
public void getUserExpandEducation() {
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/{education-experience-id}", //"/{user_education_history}",//
null,
HttpMethod.GET,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
Log.d("fb response",response.toString());
}
}
).executeAsync();
}
can anyone please reply I am getting error (#803) Some of the aliases you requested do not exist: {education-experience-id}
Finally I got full work and education detail by this code:
GraphRequest request = GraphRequest.newMeRequest(
accessToken,
new GraphRequest.GraphJSONObjectCallback() {
@Override
public void onCompleted(
JSONObject object,
GraphResponse response) {
FirstNameSocial = object.optString("first_name");
LastNameSocial = object.optString("last_name");
GenderSocial = object.optString("gender");
EmailSocial = object.optString("email", "");
id = object.optString("id");
if (!EmailSocial.equals("")) {
login_type = Config.Login_Type_facebook;
callAPI(EmailSocial, id, "");
} else {
Toast.makeText(getApplicationContext(), "Permision Denied", Toast.LENGTH_LONG)
.show();
}
}
});
Bundle parameters = new Bundle();
parameters.putString("fields", "id,name,email,birthday,gender,first_name,last_name,picture,education,work");
request.setParameters(parameters);
request.executeAsync();
Might help someone ! Happy coding :)