我需要从 Android 版 Google+ API 获取当前位置。
我已经在 Google API 控制台中完成了所有操作,并将我的应用程序与带有 SHA1 和包名称的客户端 ID 链接起来。
我成功获取了有关用户名、个人资料图片、封面图片、电子邮件的几乎数据......
但我的位置有问题。我无法获取用户位置。
我使用这个范围:
mGoogleApiClient = new GoogleApiClient.Builder(this)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this).addApi(Plus.API, null)
.addScope(Plus.SCOPE_PLUS_PROFILE).build();
我使用此代码来获取个人资料信息:
String personName = currentPerson.getDisplayName();
String userId = currentPerson.getId();
String personPhotoUrl = currentPerson.getImage().getUrl();
String personGooglePlusProfile = currentPerson.getUrl();
String email = Plus.AccountApi.getAccountName(mGoogleApiClient);
String location = currentPerson.getCurrentLocation();
String coverPhoto = currentPerson.getCover().getCoverPhoto().getUrl();
我成功地获取了所有这些数据,但我得到的位置为空。
有谁知道如何解决这个问题?
看起来像currentLocation
价值观不是目前可通过 API 获取 https://code.google.com/p/google-plus-platform/issues/detail?id=620.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)