smstuebe / xamarin-fingerprint

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

The Authenticate request fails with "UnknownError" if the app is completely unloaded on iOS #219

Open mdima opened 2 years ago

mdima commented 2 years ago

Hello, when I request the fingerprint authorization with the following conditions the authorization fails and I receive an "UnknownError" result. The conditions are: 1) This happens only on an iOS device (on Android everything works); 2) The application is completely closed (unloaded); 3) The application is loaded opening a notification, which opens a ContentPage that requests the authorization (from the DidReceiveRemoteNotification method of the AppDelegate.cs file);

Steps to reproduce

  1. From the DidReceiveRemoteNotification event of the AppDelegate.cs file create a procedure that loads a ContentPage;
  2. Inside the ContentPage, when visible (OnPropertyChanged, PropertyName == "Renderer" && the ContentPage is IsVisible) generate the fingerprint request;
  3. The request will fail immediately with the UnknownError result.

Expected behavior

The Expected behavior is that the fingerprint get successfully requested.

Configuration

Version of the Plugin: 2.1.5

Platform: iOS 15.4.1

Device: Apple iPad Air, also reproduced on an iPhone 12

smstuebe commented 2 years ago

What does result.ErrorMessage say?

mdima commented 2 years ago

The string says "Authentication canceled", status: "UnknownError"... It is very difficult to debug because to reproduce the error the app must be totally unloaded, so I added a "DisplayAlert" to display the result.

Thanks, Michele