0
votes

I followed this https://developers.google.com/+/mobile/android/getting-started and this https://developers.google.com/+/mobile/android/people guide but still I am unable to get user data.

Current situation:
I press sign in button. That executes mGoogleApiClient.connect()
For first time it makes me choose google account.
After that onConnected method is called.

@Override
public void onConnected(Bundle bundle) {
    Log.d("asd", "connected");
    Plus.PeopleApi.loadVisible(mGoogleApiClient, null).setResultCallback(this);

    // After that  fetch data
    if (Plus.PeopleApi.getCurrentPerson(mGoogleApiClient) != null) {
        Person currentPerson = Plus.PeopleApi
                .getCurrentPerson(mGoogleApiClient);

        String personName = currentPerson.getDisplayName();
        Log.d("asd", "preson name " + personName);
    }
    mShouldResolve = false;
}

then onResult method is called

@Override
public void onResult(People.LoadPeopleResult result) {
    Log.d("asd", "result.getStatus():" + result.getStatus());
}

That prints out

result.getStatus():Status{statusCode=NETWORK_ERROR, resolution=null}

Why my Plus.PeopleApi.getCurrentPerson(mGoogleApiClient) is always null?

I am using emulator with API 19 Google APIs and for certificate fingerprint I use debug SHA1

1

1 Answers

0
votes

Problem was that in manifest provided package name was incorrect.