I’m trying to get user_id, name & email from facebook via graph API. but its not sending me the email. I’m using a function like this:
void callGraphApi() {
accessToken = AccessToken.getCurrentAccessToken();
GraphRequest request = GraphRequest.newMeRequest(
accessToken,
new GraphRequest.GraphJSONObjectCallback() {
@Override
public void onCompleted(
JSONObject object,
GraphResponse response) {
tv_response.setText(response.toString());
}
});
Bundle parameters = new Bundle();
parameters.putString("fields", "id,name,email");
request.setParameters(parameters);
request.executeAsync();
}
I’m only getting a response like this:
{"id":"1480750682018443","name":"Ogwemuvwem Ossas","gender":"male"}, error: null}
Any solution??
2
Answers
In your facebook developer dashboard Go to App review in There you can see your data request permission.
If email permission not listed there you have to add it by click start a submission button on the same page.
From facebook Docs:
You can try this new api. You can pass permissions in ArrayList like this.
You can handle LoginResult like this.
I Hope it’s help for you. 🙂