Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google plus integrating: Unable to load visible circles

I want to get list of people info from google plus in my app: friends profile image URL, visible name and id.

Here's an official google plus integrating tutorial. I make the test app by this tutorial and trapped on error:

Error requesting visible circles: Status{statusCode=NETWORK_ERROR, resolution=null}

Implementing the Google Api Client:

mGoogleApiClient = new GoogleApiClient.Builder(this)
            .addConnectionCallbacks(this)
            .addOnConnectionFailedListener(this)
            .addApi(Plus.API, null)
            .addScope(Plus.SCOPE_PLUS_PROFILE)
            .addScope(Plus.SCOPE_PLUS_LOGIN)
            .build();

Here's onResult:

@Override
public void onResult(People.LoadPeopleResult loadPeopleResult) {

    if (loadPeopleResult.getStatus().getStatusCode() == CommonStatusCodes.SUCCESS) {
        PersonBuffer personBuffer = loadPeopleResult.getPersonBuffer();
        try {
            int count = personBuffer.getCount();
            for (int i = 0; i < count; i++) {
                Log.d("TEST", "Display name: " + personBuffer.get(i).getDisplayName());
            }
        } finally {
            personBuffer.close();
        }
    } else {
        Log.e("TEST", "Error requesting visible circles: " + loadPeopleResult.getStatus());
    }
}

And the permissions into AndroidManifest.xml:

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />

Please help me, what I need to do?

like image 493
david_rbk Avatar asked Nov 10 '22 11:11

david_rbk


1 Answers

I've fixed it! My problem was: I do not have specify package correctly: like this com.example but correct way is com.example.moduledir

like image 176
david_rbk Avatar answered Nov 14 '22 23:11

david_rbk