sromku / android-simple-facebook

[Deprecated] Simple Facebook SDK for Android
Other
879 stars 349 forks source link

email = null for com.sromku:simple-fb:4.1.1 #422

Open walaagomaa18 opened 8 years ago

walaagomaa18 commented 8 years ago

Profile.Properties properties = new Profile.Properties.Builder() .add(Profile.Properties.FIRST_NAME).add(Profile.Properties.GENDER) .add(Profile.Properties.EMAIL).add(Profile.Properties.LAST_NAME) .add(Profile.Properties.BIRTHDAY) .add(Profile.Properties.PICTURE) .build(); mSimpleFacebook.getProfile(properties, new OnProfileListener() { @Override public void onException(@NonNull Throwable throwable) {

                }

                @Override
                public void onFail(String reason) {
                    // TODO Auto-generated method stub

                }

                @Override
                public void onComplete(@NonNull Profile profile) {

                    emailTxt.setText(profile.getEmail());
                    fnameTxt.setText(profile.getFirstName());
                    flnameTxt.setText(profile.getLastName());
                    String gender = profile.getGender();

                }
            });

profile.getEmail() is always null

AllanWang commented 8 years ago

Make sure you have sufficient permissions before calling this. It's working for me. The email might also need to be public or viewable to you.