每次使用GoogleSignInApi显示帐户选择器 [英] show account chooser every time with GoogleSignInApi
问题描述
我正在使用Play Services 8.3中引入的新的GoogleSignInApi。它会记住上次选择的帐户,并且不会从第二次开始显示帐户选择器。但我希望它让用户每次选择帐户。看起来GoogleApiClient的clearDefaultAccountAndReconnect()方法不允许与googleSignInApi一起使用。有没有什么办法可以实现这一点,而无需实施自定义帐户选择器?
I am using the new GoogleSignInApi that was introduced in play services 8.3. It remembers the last selected account and doesn't show account picker from 2nd time onwards. But I want it to let user choose account every time. Looks like the clearDefaultAccountAndReconnect() method of GoogleApiClient is not allowed to be used with googleSignInApi. Is there any way to achieve this without implementing a custom account chooser? I am on play services 8.3 and google services 1.5.0.
推荐答案
账户选择被缓存,所以您必须调用< a href =https://developers.google.com/android/reference/com/google/android/gms/auth/api/signin/GoogleSignInApi#signOut(com.google.android.gms.common.api.GoogleApiClient) rel =noreferrer> signOut first。
The account selection is cached, so you have to call signOut first.
这篇关于每次使用GoogleSignInApi显示帐户选择器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!