在Android App中整合Facebook Api。我正在使用Facebook sdk:4.21.0,但是当GraphRequest Call生日不在Json Response中返回时。请让我知道什么是错的。我也通过向公众许可用户的出生日期进行测试。
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();
答案 0 :(得分:1)
在user_birthday
方法
logInWithReadPermissions()
参数
LoginManager.getInstance().logInWithReadPermissions(MyProfileActivity.this, Collections.singletonList("public_profile", "email", "user_birthday", "user_friends"));
或强>
loginButton = (LoginButton) findViewById(R.id.login_button);
loginButton.setReadPermissions(Arrays.asList(
"public_profile", "email", "user_birthday", "user_friends"));