firebase / FirebaseUI-Android

Optimized UI components for Firebase
https://firebaseopensource.com/projects/firebase/firebaseui-android/
Apache License 2.0
4.63k stars 1.83k forks source link

Disable back press in Firebase Auth Phone #2058

Open ArcherEmiya05 opened 2 years ago

ArcherEmiya05 commented 2 years ago

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

Step 3: Describe the problem:

Using Firebase UI for Phone Auth only, how can we disable back press?

Steps to reproduce:

  1. Create a sample project
  2. Integrate Firebase UI SDK Android
  3. Use Phone auth provider
  4. Press back

Observed Results:

No way of controlling the back press with Phone Auth Activity

Expected Results:

Should allow to add OnBackPressedCallback to allow consumer to control the back press behavior.

Relevant Code:

Something like this

AuthUI.IdpConfig.PhoneBuilder().addBackPressCallback(backPressedCallback)

private val backPressedCallback = object : OnBackPressedCallback(true) {

        override fun handleOnBackPressed() {

        }

    }
sam-gc commented 2 years ago

Thanks for filing this feature request. I can't provide any timeline but we'll keep this issue open to gauge interest from the community!