Reputation: 423
In Android App Integrated Facebook Api. I am using Facebook sdk:4.21.0,But when GraphRequest Call birthday not return in Json Response. Please let me know whats wrong. I am also tested through give the public permission to date of birth of user.
GraphRequest request = GraphRequest.newMeRequest(
AccessToken.getCurrentAccessToken(),
new GraphRequest.GraphJSONObjectCallback() {
@Override
public void onCompleted(JSONObject object, GraphResponse response) {
LogUtils.logE(TAG, "JsonResponse: " + object);
}
});
Bundle parameters = new Bundle();
parameters.putString("fields", "id,name,birthday,picture.type(large)");
request.setParameters(parameters);
request.executeAsync();
Upvotes: 0
Views: 381
Reputation: 23881
Add the user_birthday
parameter in your logInWithReadPermissions()
method
LoginManager.getInstance().logInWithReadPermissions(MyProfileActivity.this, Collections.singletonList("public_profile", "email", "user_birthday", "user_friends"));
OR
loginButton = (LoginButton) findViewById(R.id.login_button);
loginButton.setReadPermissions(Arrays.asList(
"public_profile", "email", "user_birthday", "user_friends"));
Upvotes: 1