smstuebe / xamarin-fingerprint

Xamarin and MvvMCross plugin for authenticate a user via fingerprint sensor
Microsoft Public License
490 stars 115 forks source link

Android Fallback always present #82

Closed ruisilva450 closed 6 years ago

ruisilva450 commented 6 years ago

I'm trying to hide the fallback option but on Android it just keeps showing.

Steps to reproduce

  1. Use this code:
    var config = new AuthenticationRequestConfiguration("Prove you have fingers!")
                {
                    AllowAlternativeAuthentication = false,
                    FallbackTitle = string.Empty
                };
    var result = await CrossFingerprint.Current.AuthenticateAsync(config);

    Expected behavior

    image

Actual behavior

image

Crashlog

Doesn't apply (I think)

Configuration

Version of the Plugin: 1.4.5

Platform: e.g. Android 7.0

Device: e.g. Xiaomi Redmi Note 4

smsissuechecker commented 6 years ago

Hi @ruisilva450,

I'm the friendly issue checker. Thanks for using the issue template :star2: I appreciate it very much. I'm sure, the maintainers of this repository will answer, soon.

ruisilva450 commented 6 years ago

I've tried to track the issue and it appears that the option "AllowAlternativeAuthentication" in config isn't being used at all when trying to show the dialog. https://github.com/smstuebe/xamarin-fingerprint/blob/0a2f2699c44cde97cd43080a0264477e404df347/src/Plugin.Fingerprint.Android/Dialog/FingerprintDialogFragment.cs#L93 https://github.com/smstuebe/xamarin-fingerprint/blob/0a2f2699c44cde97cd43080a0264477e404df347/src/Plugin.Fingerprint.Android/Dialog/FingerprintDialogFragment.cs#L160

EDIT: My suggestion is to add this line:

_fallbackButton.Visibility = Configuration.AllowAlternativeAuthentication ? ViewStates.Visible : ViewStates.Gone;

Btw, why the dialog is not the native one in the expected behavior? There is a way to customize this far?

JeminiRiver commented 6 years ago

I can confirm I'm seeing the same behavior.

tenneyb commented 6 years ago

Has anyone gotten a Title like above "Sign In" to show up? if so how :)

galadril commented 6 years ago

Please add a possibility to remove the fallback button