我们正在使用适用于Android的Google登录API将用户登录到我们的应用,并且还可以访问某些范围 . 我们当前的实施工作正常,除了细节 . 当用户提示从设备中选择帐户时,如果他选择“添加新帐户”选项,则会调用一个新活动(来自Google登录API),用户可以在该帐户中添加用户名和密码,但我们得到的行为是,此帐户会自动添加到设备中的帐户(在“设置”>“帐户”下) .
有没有办法使用Google登录API登录帐户(它不在设备上)而不添加它?
我们正在使用的代码是......
GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestIdToken(BuildConfig.SERVER_CLIENT_ID)
.requestEmail()
.build();
mGoogleApiClient = new GoogleApiClient.Builder(this)
.enableAutoManage(this /* FragmentActivity */, this /* OnConnectionFailedListener */)
.addApi(Auth.GOOGLE_SIGN_IN_API, gso)
.build();
if (mGoogleApiClient.isConnected()) {
Auth.GoogleSignInApi.signOut(mGoogleApiClient);
mGoogleApiClient.clearDefaultAccountAndReconnect();
}
Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient);
startActivityForResult(signInIntent, RC_GET_TOKEN);
任何线索或帮助将不胜感激 . :)