react-native-google-sign-in icon indicating copy to clipboard operation
react-native-google-sign-in copied to clipboard

How do I know if a user is already logged in when my app starts?

Open BerndWessels opened this issue 8 years ago • 2 comments

Hi I don't want to force the user to log in each time my (Android) App starts. Basically my App offers Facebook and Google Login the first time it starts. Once the user logged in with Facebook or Google the app should remember this. Next time the user starts my app he should be already logged in.

The react-native-facebook-login calls an onLoginFound callback which tells my app if the user is already logged in to my app.

How do I achieve the same with react-native-google-sign-in ?

@stami

BerndWessels avatar Jun 21 '17 21:06 BerndWessels

@BerndWessels You may want to see https://github.com/joonhocho/react-native-google-sign-in/blob/master/js/GoogleSignIn.ios.js for all supported APIs. See GoogleSignIn.android.jos as well if you are using Android.

joonhocho avatar Jul 27 '17 08:07 joonhocho

What should i prefer, if I am not using google and facebook authentication. I am using my own database using login API. Can you please suggest how to maintain the session?

fazeelzama20 avatar Dec 06 '17 06:12 fazeelzama20