rememberFirebaseGoogleSignInState
fun rememberFirebaseGoogleSignInState(linkAccount: Boolean = false, filterByAuthorizedAccounts: Boolean = false, isAutoSelectEnabled: Boolean = true, scopes: List<String> = listOf("email", "profile"), onResult: (Result<FirebaseUser?>) -> Unit): SignInState
Google Sign-In exchanged for a Firebase session, as a Compose state holder. Make sure GoogleAuthProvider.create was called at application start.
Parameters are read at launch time: recomposing with new values (e.g. toggling linkAccount between sign-in and sign-up modes) updates the existing state, and SignInState.launch uses whatever is current when the user taps.
val googleSignIn = rememberFirebaseGoogleSignInState(onResult = onFirebaseResult)
GoogleSignInButton(onClick = { googleSignIn.launch() })Content copied to clipboard
Parameters
linkAccount
true links the credential to the currently signed-in Firebase user instead of creating a new session.
onResult
receives the signed-in FirebaseUser or the failure.