2

Many people have more than one Google account. I'd like to support multiple Google accounts in my app. I'm having trouble getting a prompt for the user to sign in with a second account.

The user can sign in to one account just fine. Calling sign in the first time results in a call to the delegate with all of the expected values.

When I call signIn again, my app doesn't switch to the Google sign in UI but instead the delegate is called immediately. The values returned to the delegate are for the first account. In that sense, it's working like signInSilently.

I'm using the iOS Google Sign In SDK version 2.1.0. I'm using the iOS simulator.

Does the sign in sdk support more than one account? And if so, how?

My preferred behavior would be for signIn to always prompt the user to sign in.

rascal2210
  • 905
  • 7
  • 11

1 Answers1

0

Calling signOut before calling signIn will bring up the prompt window again. The token (or at least the refresh token) seems to still be active after signing out so access to all accounts is still possible.

rascal2210
  • 905
  • 7
  • 11
  • Now you're signin to second out as per your answer. Now you want first user access token. ie After signout for first account, then how will you get access token for first account? – Mani Sep 04 '15 at 07:22
  • We persisted the access token and refresh token from the first login. Calling sign out on the first account did not prevent us from using the saved tokens to access the first account.However, in the end, we abandoned the Google SDK in favor of Xamarin Auth, which is open source so we could fix a few issues that prevented it from working well with Google OAUTH2 implementation. – rascal2210 Sep 05 '15 at 15:34
  • I know that. But one thing, you may know, anyway I just remember that google access token will expire in 1hour. So First account signout will not work after 1 hour. right? There's many source avail for Google OAuth2. But I want to use GIDSignIn. If there's no way with GIDSignIn, I'll back with any of open source. Thank you rascal2210.. – Mani Sep 07 '15 at 05:41