Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

signoutpromise broken (iOS) #16

Closed
YousefED opened this issue Feb 22, 2017 · 9 comments
Closed

signoutpromise broken (iOS) #16

YousefED opened this issue Feb 22, 2017 · 9 comments

Comments

@YousefED
Copy link

I think signout promise never resolves, because you're listening for disconnect events.

If just doing a sign out, the user will only be signed out locally and the disconnect events never raise.

Just calling .signOut doesn't work either, as this is dispatched async on iOS, so the function returns before the user is signed out.

For my own workaround, I've removed the async dispatch in signOut https://github.com/YousefED/react-native-google-sign-in/blob/master/ios/RNGoogleSignIn/RNGoogleSignIn.swift. Not sure this is the correct solution, but seems to be working for our use case now

@jasonnathan
Copy link

I've experienced this too. My UI hangs on awating the Promise to resolve. Tapping the button again signs the user out

@cristian-milea
Copy link

same problem,

thanks @YousefED for quick-fix

jasonnathan added a commit to jasonnathan/react-native-google-sign-in that referenced this issue Jun 30, 2017
@RalfNieuwenhuizen
Copy link

@joonhocho what's your view on this?

@joonhocho
Copy link
Owner

@YousefED If you remove async, are you saying it will raise disconnect event and thus resolved?

@YousefED
Copy link
Author

YousefED commented Sep 9, 2017

@joonhocho honestly this is a while ago, I see we also made the following change to resolve this issue: YousefED@8227feb. Don't remember 100% but looks related :)

@YousefED
Copy link
Author

@joonhocho the core of the issue is, is that:

await signOutPromise()

never resolves on iOS. the onDisconnect / onDisconnectError handlers are never called.

Do you have a suggested fix?

@calvinkei
Copy link

experiencing the same issue, signOutPromise never resolve (nor reject)

@joonhocho
Copy link
Owner

@YousefED @jasonnathan @frozenxis @RalfNieuwenhuizen @calcal12

This issue has been fixed with new version.

Just upgraded to the latest Google SignIn SDK for iOS. (npm version 1.0.16)
Please follow new instructions carefully.
https://github.com/joonhocho/react-native-google-sign-in#ios
Also refer to ExampleApp if something is not working. I've tested ExampleApp and is working fine.
Feel free to reopen this issue if you cannot get it working.

@joonhocho
Copy link
Owner

FYI, signout should never call 'disconnect' events. disconnect should raise disconnect events. I fixed it accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants