草庐IT

getCurrentPerson

全部标签

android - Plus.PeopleApi.getCurrentPerson 返回 null

我目前正在开发我的应用中的GooglePlus登录功能。我像下面这样创建了GoogleApiClient构建器Plus.PlusOptionsoptions=newPlus.PlusOptions.Builder().addActivityTypes("http://schemas.google.com/AddActivity").build();myGoogleApiClient=newGoogleApiClient.Builder(this).addConnectionCallbacks(this).addOnConnectionFailedListener(this)//.add

android - 适用于 Android 的 Google+ 平台 - getCurrentPerson

我使用适用于Android的Google+平台PlusClientplusClient=newPlusClient.Builder(this,this,this).setScopes(Scopes.PLUS_LOGIN).build();在onConnected-Listener中我想读取登录用户的数据@OverridepublicvoidonConnected(){super.onConnected();Personperson=plusClient.getCurrentPerson();}方法调用getCurrentPerson返回null。有没有人设法读取用户数据?

Android Google Plus getCurrentPerson 返回 null

当我调用plusClient.getCurrentPerson()时,我得到NULL。方法onConnected(Bundle...)在成功登录后调用:@OverridepublicvoidonConnected(Bundlebundle){if(plusClient.getCurrentPerson()==null){Log.e("DD","Personisnull!");}}我直接从eclipse(Window->Preferences->Android->Build)添加了SHA1。我不知道我做错了什么!来自EclipseADT的SHA1指纹已安装应用程序的客户端ID简单的API

android - Plus.PeopleApi.getCurrentPerson 在 Play 服务 8.4 中已弃用。如何使用 GoogleSignInApi 获取用户的名字、姓氏和性别?

使用Play服务8.4,方法getCurrentPerson已弃用,我使用PeopleApi获取用户的名字、姓氏和性别。谁能告诉我如何使用其他方法获取已登录用户的信息? 最佳答案 更新:检查伊莎贝拉的回答。此答案使用已弃用的内容。我自己找到了解决方案,所以如果有人遇到同样的问题,我会把它贴在这里。虽然我一直在寻找使用GoogleSignInApi获取用户信息的解决方案,但找不到,我认为我们需要使用PlusApi来获取性别等信息。@OverridepublicvoidonActivityResult(intrequestCode,in