How to get gender from GoogleSignInAccount (previous method is now deprecated)

Plus.PeopleApi.load(mGoogleApiClient, googleUser.getId()).setResultCallback(new ResultCallback<People.LoadPeopleResult>() {
            @Override
            public void onResult(@NonNull People.LoadPeopleResult loadPeopleResult) {
                Person person = loadPeopleResult.getPersonBuffer().get(0);
                gender = person.getGender();
                loadPeopleResult.release();
            }
        });

This is the code that I have used so far to get the floor from GoogleSignInAccount, which is currently the proper way to integrate Google into Android applications. But since the update 9.4.0 for com.google.android.gms: play-services-plus, the entire Plus class has been deprecated, including the PeopleApi method and load. I read tons of Google documentation, but I just can't find the right way to get the floor.

+4
source share
1 answer

Yes Plus is out of date.

: com.google.android.gms.plus.model.people , , : https://developers.google.com/android/reference/com/google/android/gms/plus/model/people/package-summary

, API plus.model.people, - Person.Gender. , :
getGender().

+1

Source: https://habr.com/ru/post/1650052/


All Articles