Google plus integrating: Unable to load visible circles

走远了吗. 提交于 2019-12-06 03:21:55

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/22380217/google-plus-integrating-unable-to-load-visible-circles

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!