smstuebe / xamarin-fingerprint

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

App crashing on 2.1.1 on iOS 13.x #179

Closed devWaleed closed 3 years ago

devWaleed commented 4 years ago

Steps to reproduce

  1. Updated from 1.4. version to latest version 2.

  2. Launch app on iOS

  3. App crashes, exception is not catched in try catch, no errors show in output

I have this piece of code here:

var request = new AuthenticationRequestConfiguration("Login via Fingerprint", "");

var result = await CrossFingerprint.Current.AuthenticateAsync(request);

As soon as i pass AuthenticateAsync line, app will close, debugging will stop, no output or exception is generated

Expected behavior

Let app run

Configuration

Version of the Plugin: Latest 2.1.1

Platform: iOS 13.x

Device: iPhone 6s

smsissuechecker commented 4 years ago

Hi @devWaleed,

I'm the friendly issue checker. It seems like (25.00 %) you haven't used our issue template :cry: I think it is very frustrating for the repository owners, if you ignore them.

If you think it's fine to make an exception, just ignore this message. But if you think it was a mistake to delete the template, please close the issue and create a new one.

Thanks!

smstuebe commented 4 years ago

A immediate crash usually happens only if you miss something in the plist.

Did you add:

<key>NSFaceIDUsageDescription</key>
<string>Need your face to unlock secrets!</string>  

??

devWaleed commented 4 years ago

@smstuebe yes its added in the plist but string is different

devWaleed commented 4 years ago

@smstuebe can it crash due to different string? what could be the other reason?

I am working on a project in which Android and iOS both use this plugin. Previous version of the plugin was 1.4.9 and it was working completely fine on both platform.

However we decided to update our packages. This is working for android correctly after upgrade but on iOS it doesn't. It doesn't give any output, or exception or error anywhere.

I have to downgraded again in order to run both projects again.

What could be the reason here?

smstuebe commented 4 years ago

can it crash due to different string?

no the reason string is specific for you application. You need to change it to what ever describes the usage of your biometric auth the best in the context of your app.

Without more info it is just guessing.... Don't want to spend my time guessing.

Did you do a clean build? Have you ensured, the references are set correctly? A crash without any out doesn't usually happen. Have you checked the device logs? etc...

It's working in other apps. So in your setup / build there must be something special. If you have a proper error message / exception or a reproducible minimal example, I can help you.

geoweir commented 3 years ago

I had this same issue and fixed it by passing the same string set as the reason for the permission in the plist file as the second parameter to the function, eg

plist file

<key>NSFaceIDUsageDescription</key>
<string>Need your face to unlock secrets!</string>  

Code to authenticate

var request = new AuthenticationRequestConfiguration("Login via Fingerprint", "Need your face to unlock secrets!");
var result = await CrossFingerprint.Current.AuthenticateAsync(request);