是否可以在 Google+ 登录的情况下在 Android 应用程序中使用 GoogleApiClient?

Is it possible to use the GoogleApiClient in an Android app without Google+ sign in?

我的 Android 应用程序涉及地图和位置更新。位置更新特别需要一个 GoogleApiClient 实例:

LocationServices.FusedLocationApi.requestLocationUpdates(service.getGoogleApiClient(), locationRequest, this);

我想同时提供 Google+ 和 Facebook 作为登录选项,并且已经实现了。但是在测试 Facebook 登录时,我注意到 GoogleApiClient 实例未连接。如果我尝试连接它,它将失败并显示 SIGN_IN_REQUIRED

对我来说 SIGN_IN_REQUIRED 意味着用户交互类似于 Google+ 登录。是否可以在用户未使用 Google+ 登录的情况下使用 Google Play 服务之类的东西,例如位置更新?

这完全取决于您通过 addApi - if you include an API that requires login (such as Plus.API, then yes, you will need the user to sign in. If however, you only include APIs that do not require login (such as LocationServices.API 添加到 GoogleApiClient 的 API),则无需登录。

注意:您 仅限于一个 GoogleApiClient - 如果您想为 Plus.API 保留一个,为 LocationServices.API,你当然可以做到。