Skip to content

Instantly share code, notes, and snippets.

@oradkovsky
Created March 9, 2020 15:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oradkovsky/1ac7c4054e41fdb3a64ce6388003a19a to your computer and use it in GitHub Desktop.
Save oradkovsky/1ac7c4054e41fdb3a64ce6388003a19a to your computer and use it in GitHub Desktop.
if (FirebaseAuth.getInstance().currentUser == null) {
// user needs to authenticate
val providers = arrayListOf(
AuthUI.IdpConfig.GoogleBuilder().build()
)
startActivityForResult(
AuthUI.getInstance()
.createSignInIntentBuilder()
.setAvailableProviders(providers)
.build(),
RQ_FIREBASE_AUTH
)
} else {
//user is authenticated
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment