Jason Inbody

    1 year ago
    Is there any example code on how to use the google sign in button in jetpack compose? Or do I need to wrap the google sign in button in an android view?
    val gso = GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
    val mGoogleSignInClient = GoogleSignIn.getClient(user.context, gso)
    val signInIntent = mGoogleSignInClient.signInIntent
    val googleSignInLauncher = rememberLauncherForActivityResult(
        contract = ActivityResultContracts.StartActivityForResult()
    ){ result: ActivityResult ->
        if (result.resultCode == Activity.RESULT_OK) {
            //  you will get result here in
            val task: Task<GoogleSignInAccount> = GoogleSignIn.getSignedInAccountFromIntent(
            user.openErrorDialog("Google Sign In Failure", "Failed to sign in with Google")
    then launch with
    worked for me