Leave a Google session sing in


#1

Good afternoon

These are probably stupid questions, but since this community is always helping.

  1. When I sign in with Google, how can I leave that session open? Even if the user close the app
  2. How can I make a sign out button?

Thank for all your help.

I manage to make my app, but I need to know how to do these two things


#2

Hey @ispcloudservices,

I don’t believe it’s possible to persist the particular session, but you should be able to save the tokens you receive on a successful log-in via AsyncStorage and then fetch them when your app is launched so the user doesn’t have to enter the credentials every time.

As for making a button, you’ll want to make use of TouchableOpacity, TouchableHighlight or TouchableBounce to wrap your button component (Views and Text). You’ll then handle the signing out logic via the onPress property whatever Touchable you used.

Cheers,

Adam


#3

Thanks Adam, about the first question are you sure? because in Android Studio,if you use firebase you can do something like

if (firebase.GetCurrentUser == null){
         // User is already log in
}

closed #4

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.