smstuebe / xamarin-fingerprint

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

iOS crashes when AuthenticationRequestConfiguration reason is empty string. #220

Open ttranbunnings opened 2 years ago

ttranbunnings commented 2 years ago

Steps to reproduce

  1. Use request with empty string
    var request = new AuthenticationRequestConfiguration("Enable Touch ID", "");
    var setupResult = await CrossFingerprint.Current.AuthenticateAsync(request);

Expected behavior

Should not crash on iOS

Actual behavior

App crashes on iOS

Crashlog

Objective-C exception thrown. Name: NSInvalidArgumentException Reason: Non-empty localizedReason must be provided.

Configuration

**Version of the Plugin: 2.1.5

Works fine, no crash on Android with empty string for AuthenticationRequestConfiguration reason.

smstuebe commented 2 years ago

Hi,

Have you tried what the error message suggests? (set a non-empty reason) :D If iOS want's a reason, the plugin can't do anything about it (except adding an additional validation).