gpt4 book ai didi

android - Google+ 使用 Play 服务登录 6.5.87 (GoogleApiClient) - Android

转载 作者:塔克拉玛干 更新时间:2023-11-02 22:31:35 26 4
gpt4 key购买 nike

我在 Play Services 6.1.71 中使用:

mPlusClient = new PlusClient.Builder(this,this,this).setActions("http://schemas.google.com/AddActivity", "http://schemas.google.com/BuyActivity") .setScopes(Scopes.PLUS_LOGIN, Scopes.PROFILE).build();

但在 Google Play Services 6.5.87 中,Google 建议改为将 PlusClient 更改为 GoogleApiClient.Builder。但是我无法像以前那样获取用户信息:

mPlusClient.getAccountName() 

mPlusClient.getCurrentPerson()

如何检索用户信息?我认为 Google 文档已过时。希望您能够帮助我。谢谢。

最佳答案

使用 GoogleApiClient,而不是 PlusClient。示例:

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

getAccountName() 使用Plus.AccountApi.getAccountName(mGoogleApiClient)

getCurrentPerson() 使用 Plus.PeopleApi.getCurrentPerson(mGoogleApiClient)

关于android - Google+ 使用 Play 服务登录 6.5.87 (GoogleApiClient) - Android,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27472435/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com