Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add skip button as custom sign-in layout option #2148

Open
MirecXP opened this issue Nov 27, 2023 · 0 comments
Open

Add skip button as custom sign-in layout option #2148

MirecXP opened this issue Nov 27, 2023 · 0 comments

Comments

@MirecXP
Copy link

MirecXP commented Nov 27, 2023

Welcome to FirebaseUI and thanks for submitting an issue!

Please take a look at open issues, as well as resolved issues, to see if your issue is either already being addressed, or has been solved by someone else.

If not, please feel free to fill in the following info so we can help faster!

Step 1: Are you in the right place?

Yes.

Step 2: Describe your environment

  • Android device: any
  • Android OS version: any
  • Google Play Services version: any
  • Firebase/Play Services SDK version: any
  • FirebaseUI version: any

Step 3: Describe the problem:

The AuthUI login can be started as part of an onboarding flow. To simplify the UX, we do not want to add a separate onboarding screen for the user to decide whether they want to log in or not. So having a skip button available directly on the sign-in screen would help a lot.
The sign in screen can be cancelled by navigating back, but this is not suitable if the sign-in screen is part of some flow.

Steps to reproduce:

  1. Create custom sign-in layout (with optional skip/close/cancel button)
  2. Create sign-in intent using custom layout
  3. Launch sign-in activity using signInIntent

Observed Results:

It is not possible to cancel the launched sign-in activity with a custom button.

Expected Results:

I can use a custom button to cancel the sign in, e.g. Continue without login and I do not need a separate screen for that.

Relevant Code:

       val customSignInLayout: AuthMethodPickerLayout = AuthMethodPickerLayout.Builder(R.layout.onboarding_login_layout)
          .setGoogleButtonId(R.id.google_signin_button)
          .setAppleButtonId(R.id.apple_signin_button)
          .setTosAndPrivacyPolicyId(R.id.tos_link)
          .setSkipButtonId(R.id.skip_signin_button) // <-- this would be very useful
          .build()

      var signInIntent = AuthUI.getInstance()
          .createSignInIntentBuilder()
          .setAvailableProviders(providers)
          .setIsSmartLockEnabled(false)
          .setAlwaysShowSignInMethodScreen(true)
          .setLogo(R.mipmap.ic_launcher)
          .setTosAndPrivacyPolicyUrls(termsUrl, privacyUrl)
          .enableAnonymousUsersAutoUpgrade()
          .setAuthMethodPickerLayout(customSignInLayout)

      launcher.launch(signInIntent.build())  ```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant