joonhocho / react-native-google-sign-in

React Native Wrapper for Latest Google Sign-In OAuth SDK / API
MIT License
211 stars 64 forks source link

Error code 8 with new account sign in #85

Open theAdmiralNelson opened 6 years ago

theAdmiralNelson commented 6 years ago

I only get the error INTERNAL ERROR CODE 8 when I try to sign in with a new account (An account that isn't listed when Google lists out possible accounts to sign in with). Otherwise, everything works perfectly. I've seen all of the posts about error code 10, however, since I am able to sign in with any existing account on the phone, I'm pretty sure it has nothing to do with my debug SHA1 key. (I've also checked it for sure).

I get the error when running:

try { await GoogleSignIn.configure(config.oauth.google)

const googleUser = await GoogleSignIn.signInPromise()

console.log(googleUser)

Here's config.oauth.google (minus the serverClientID):

oauth: { google: { scopes: [ 'https://www.googleapis.com/auth/plus.me', 'https://www.googleapis.com/auth/userinfo.email', 'https://www.googleapis.com/auth/userinfo.profile' ]}}

Anybody seen this before?

qudde commented 6 years ago

yes, i have if(e.code === 8) --> invoke login function again and it will auto login to the right account

theAdmiralNelson commented 6 years ago

Yeah, I was trying that work-around as well. However, it seemed like it required one more touch event from the user to actually go through. I’m not totally sure why. Can you post your full work-around, @qudde? Thanks so much for verifying that it will work!

ldejana commented 6 years ago

@theAdmiralNelson Did you fix this? If yes can you please write your solution?

theAdmiralNelson commented 6 years ago

Handling the case that the error.code === 8 by calling GoogleSignIn.signInPromise() again works. But, it requires a touch event from the user before error.code gets returned. Otherwise, the app just hangs. So, I suppose if there's a way to simulate a touch event inside of javascript, that'd be the way to do it. But, no, I haven't gotten it to work just yet.

tallen11 commented 6 years ago

Do we know why it hangs? It only hangs on some versions of Android, but not on others. Anyone have a solution to this.