如何在 android 中从 facebook 获取生日我正在使用 android-simple-facebook 库,但它不能使用它的生日权限。请引导我朝着正确的方向前进。
Permission[] permissions = new Permission[] { Permission.EMAIL,
Permission.USER_BIRTHDAY };
OnProfileListener onProfileListener = new OnProfileListener() {
@Override
public void onComplete(Profile profile) {
Log.i("sampleFB", "My profile id = " + profile.getEmail());
Log.i("sampleFB", "My profile id = " + profile.getGender());
Log.i("sampleFB", "My profile id = " + profile.getFirstName());
Log.i("sampleFB", "My profile id = " + profile.getLastName());
Log.i("sampleFB", "My profile id = " + profile.getBirthday());
// String str = Utils.toHtml(profile);
// mResult.setText(Html.fromHtml(str));
}
/*
* You can override other methods here: onThinking(), onFail(String
* reason), onException(Throwable throwable)
*/
};
Profile.Properties properties = new Profile.Properties.Builder()
.add(Properties.ID).add(Properties.FIRST_NAME)
.add(Properties.EMAIL).add(Properties.BIRTHDAY).build();
mSimpleFacebook.getProfile(onProfileListener);`