【问题标题】:Get Google+ friends from People API从 People API 获取 Google+ 朋友
【发布时间】:2017-02-22 16:58:42
【问题描述】:

我正在尝试从 People API 中获取所有 Google+ 朋友。

我按预期获取了我的所有联系人,只是缺少 G+ 联系人。

我已要求以下范围

 GoogleSignInOptions gso = new GoogleSignInOptions.Builder( GoogleSignInOptions.DEFAULT_SIGN_IN )
                .requestIdToken( getString( R.string.default_web_client_id ) )
                .requestEmail()
                .requestProfile()
                .requestScopes( new Scope( Scopes.PLUS_ME ) )
                .requestScopes( new Scope( PeopleScopes.CONTACTS ) )
                .requestScopes( new Scope( PeopleScopes.PLUS_LOGIN ) )
                .requestScopes( new Scope( PeopleScopes.USERINFO_PROFILE ) )
                .build();

我忘记了一些范围吗?否则我该如何访问它们?我的方法是执行以下操作。这将返回我的 google 联系人联系人,但我朋友的 Google+ 帐户除外。

People service = new People.Builder( HTTP_TRANSPORT, JSON_FACTORY, credential )
                        .setApplicationName( "REST API sample" )
                        .build();
ListConnectionsResponse connectionsResponse = service
                    .people()
                    .connections()
                    .list( "people/me" )
                    .execute();

【问题讨论】:

    标签: android google-api google-plus google-people-api


    【解决方案1】:

    Google People API 无法获取 Google+ 好友列表。您只能获取联系人中的人员列表。

    【讨论】:

    • 不幸的是,已弃用的 Google+ API 列表调用不再返回连接的人。所以没有办法得到这个信息。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-03-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多