smstuebe / xamarin-fingerprint

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

V2.0 Feedback collection #151

Closed smstuebe closed 2 years ago

smstuebe commented 4 years ago

I have released a preview version of the plugin.

Please provide feedback directly in this issue.

Major changes

Installation

Why prerelease Xamarin has not released Android X as stable packages for 1 year... NuGet doesn't allow realeasing stable packages, if the package has pre-release dependencies.

see:

Known Issues

Needs to be tested

Other Todos

tranb3r commented 4 years ago

Awesome work! No major issue so far for me. One question: is it possible to test facial unlock on the android emulator? (or does one need a physical pixel 4 for that ?)

smstuebe commented 4 years ago

@tranb3r I rarely test with the simulator. I can't really tell if there is/will be support for that in the emulator (google is relatively slow with enhancing the emulator :/). So it seems you have to borrow/buy a pixel device. But good point. I'll ask if one of my colleagues/friends own a device using facial unlock. I'll extend the issue with a "things to test" section

tranb3r commented 4 years ago

On Android 23/6.0/M, GetAvailabilityAsync now returns "NoSensor" (while it was returning "Available" before). I see that you're using version rc01 of androidx's biometric. Maybe this has been fixed in the stable 1.0.0 that has been released a few days ago ?

smstuebe commented 4 years ago

@tranb3r yes. I tried to update to 1.0.0 yesterday, but unfortunately it depends on 1.1.0 versions of other android x packages that are not released, yet :( You can follow the discussion if you click on the linked Issue 208) Can you please always write the Android Version, Device, Plugin Version?

joshkautz commented 4 years ago

Got a little time to play around with it - nothing giving me trouble so far! Thanks for the prelease; all your hard work is greatly appreciated! Hope to be able to do my part to help!

srqdev commented 4 years ago

Running the test app on a Galaxy S10. Two things, first the facial recognition works and is very quick. But second, I would like to be able to select between facial and finger recognition, I have facial recognition turned on for my device and this works with the dialog at the bottom. If I turn off facial recognition, the dialog moves into the middle and works correctly. For my app I would like to only recognize fingerprints i.e. a positive action to log in and not just my face happens to be there. Also can we have a bit more configurability in dialog to be able to change the icon. Everything else seems good so far.

tranb3r commented 4 years ago

Xamarin.AndroidX.Biometric 1.0.0-preview03 nuget has been published, along with 1.1.0-preview03 dependencies.

smstuebe commented 4 years ago

Updated Dependency to official AndroidX nuget: https://www.nuget.org/packages/Plugin.Fingerprint/2.0.0-alpha.3

tranb3r commented 4 years ago

The issue on Android 23 that I mentionned before is fixed in alpha4. Thanks for that !

smstuebe commented 4 years ago

The issue on Android 23 that I mentionned before is fixed in alpha4. Thanks for that !

That's awesome. Thx for testing.

lhughey commented 4 years ago

I haven't tested this out (yet). I'll begin doing so this weekend.

I wanted to thank you for the time and effort that you put into this component. There are way too many apps that depend on your hard work. I made a donation. Its not enough for the value you provide but consider it a token of my appreciation.

pzimmermaninmo commented 4 years ago

Tested latest 2.0.0-alpha.5 release on Android (within Xamarin forms app) and everything seems to be working fine.

However, I tried setting the current activity using the current activity plugin like: CrossFingerprint.SetCurrentActivityResolver(() => CrossCurrentActivity.Current.Activity); And it would either throw an exception saying "Are you sure youre using the androidx.migration library" (which I am) or just wouldn't display at all. Not sure if thats specific to your library or something with xamarin/android x itself. One thing to note here, I am using the Rg.Plugins.Popup to ask the user if they would like to use biometrics to login to my app before calling AuthenticateAsync.

That said, using the MainActivity like this, as shown in the sample app worked: CrossFingerprint.SetCurrentActivityResolver(() => this);

Like everyone else has said, I appreciate all your work on getting the androidx library working with this. Previously I was rolling my own Biometric service and was dreading having to create a custom biometric prompt for android 6-8. Why Google didn't standardize that in the API like iOS is beyond me.

smstuebe commented 4 years ago

@lhughey thanks alot :) @pzimmermaninmo I assume you are hitting this exception? https://github.com/smstuebe/xamarin-fingerprint/blob/master/src/Plugin.Fingerprint/Platforms/Android/FingerprintImplementation.cs#L74

Can you post the exact exception message? Do you have a sample app where this error occurs?

pzimmermaninmo commented 4 years ago

That was the exception. I figured out the problem. I forgot to add this to my MainActivity: CrossCurrentActivity.Current.Init(this, bundle);

Carry On.

smstuebe commented 4 years ago

@pzimmermaninmo ok. But maybe I can make it more clear. I'll add a check for null and hint the user to his possible mistake better.

marcelo2231 commented 4 years ago

@smstuebe I tested on Android 9, and the FaceID did not work. See the following video: https://youtu.be/3A3p-DtVcmg Tested on Samsung S10 (Android 9.0)

marcelo2231 commented 4 years ago

@smstuebe Just an Update. I tested on a Pixel 4 (Android 10) and it worked as expected. I believe this library and Xamarin.AndroidX are not expected to support Samsung Android 9 Face Recognition, right? Just the phones that use the android 10 biometrics or something like that? Pixel 4 Video: https://youtu.be/PP4bMlhkcIc iOS Video: https://youtu.be/W9ViAjfH6YQ

Again, Thank you SO MUCH for your amazing work. Your library helps many applications out there, and we are really grateful for it. You are a true MVP =D

Update: It is not related to Android 9, 10, sorry for my ignorance haha. I updated my Samsung S10 to android 10 and it doesnt work, it is just Samsung way to do face ID. Meh...

smstuebe commented 4 years ago

Hmm there is one more option regarding face unlock I want to play around with. But it's not like there is a list of methods I can allow. Ofc: if the vendor does not implement the API well, I can't do anything :(

You are a true MVP

I'm not an MS MVP anymore ^^

vineet1810 commented 4 years ago

can someone send code for faceid authentication ?

noxe commented 4 years ago

Hi,

i currently use V2.0 of the fingerprint plugin - everything works really fine - thank you for that!

However i have one issue - i use Media Plugin to take Photos - when returning to the app OnResume is called on Android - in this case (i want fingerprint authentication in generell when returning to the app) - the authentication craches with this error. I there a bug in the plugin - or do i need to configure something different here when returning from the media picker?

thank you!!

System.InvalidOperationException: 'Expected current activity to be 'AndroidX.Fragment.App.FragmentActivity' but was 'Plugin.Media.MediaPickerActivity'. You need to use AndroidX. Have you installed Xamarin.AndroidX.Migration in your Android App project!?'

0x8A in Plugin.Fingerprint.FingerprintImplementation.NativeAuthenticateAsync at d:\a\1\s\src\Plugin.Fingerprint\Platforms\Android\FingerprintImplementation.cs:74,17    C#
0x33 in System.Runtime.CompilerServices.AsyncTaskMethodBuilder<Plugin.Fingerprint.Abstractions.FingerprintAuthenticationResult>.Start<Plugin.Fingerprint.FingerprintImplementation.<NativeAuthenticateAsync>d__4> at /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:471,17  C#
0x2F in Plugin.Fingerprint.FingerprintImplementation.NativeAuthenticateAsync    C#
0xC2 in Plugin.Fingerprint.Abstractions.FingerprintImplementationBase.AuthenticateAsync at d:\a\1\s\src\Plugin.Fingerprint\Abstractions\FingerprintImplementationBase.cs:24,13  C#
0x33 in System.Runtime.CompilerServices.AsyncTaskMethodBuilder<Plugin.Fingerprint.Abstractions.FingerprintAuthenticationResult>.Start<Plugin.Fingerprint.Abstractions.FingerprintImplementationBase.<AuthenticateAsync>d__0> at /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:471,17   C#
0x37 in Plugin.Fingerprint.Abstractions.FingerprintImplementationBase.AuthenticateAsync C#

0xCB in VenDoc.App.RaiseAuthentication at E:\Entwicklung\VenDoc_Mobile\VenDoc\VenDoc\App.xaml.cs:110,17 C# 0x33 in System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start<VenDoc.App.d__9> at /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:471,17 C# 0x23 in VenDoc.App.RaiseAuthentication C# 0x1A in VenDoc.App.EnterForeground at E:\Entwicklung\VenDoc_Mobile\VenDoc\VenDoc\App.xaml.cs:57,13 C# 0x33 in System.Runtime.CompilerServices.AsyncVoidMethodBuilder.Start<VenDoc.App.d__4> at /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:84,17 C# 0x2A in VenDoc.App.EnterForeground C# 0x1C in VenDoc.App.OnResume at E:\Entwicklung\VenDoc_Mobile\VenDoc\VenDoc\App.xaml.cs:100,17 C#

xamarinnerd commented 4 years ago

@smstuebe I have a XF application, which uses Plugin.Fingerprint v2.1.1 with all AndroidX libraries at tip, except Xamarin.AndroidX.Browser(my project uses v1.0 as v1.2 throws error). However, after the Fingerprint Dialog been shown and either Press Cancel or Place Finger the dialog gets dismissed , but mobile app gets hung or not responding. Not sure of anyone came across this issue. Note - My XF application primarily has a Webview which loads a website and planning to add biometric to it. packages.zip Appreciate your help in advance.

katanza12 commented 4 years ago

I have the same problem. For now I downgraded the plugin at the last version before 2.0.0 (that implement the FragmentActivity) and it works. But we need a different solution for the future

Ayesh02 commented 4 years ago

Hi, I am trying to implement face id authentication using this library. I am trying to determine auth type based on this method: await CrossFingerprint.Current.GetAuthenticationTypeAsync()

However, i am always getting the result as Fingerprint instead of Face when i have no Fingerprint enrolled in my phone. Can i know why?

device os: Android 9 & 10 device name: Samsung Galaxy Note 9

JohnBirju commented 3 years ago

Dear @smstuebe , In our Xamarin forms application we have provided biometric login support PFB details for that. Nudget package name : Xamarin- fingerprint. Version: 2.1.0 Method/ API : GetAuthenticationTypeAsync() Platform: Android Issue description: above used API does not return Face id option , each time it returning Touch id even if the Face id enabled on device. Expectation: If the Touch and Face id available on the device then it should return both the options. Tested on: 1) pixel 2(android 9) , 2) samsung galaxy 8 (android 6), 3) nexus 6(android 10) , 4)one plus(android 10).

we tried on this device's, and for this provided device we are getting only touch id, not the Face id.

Could you please help us for resolving above issue as we need to add Touch and Face id both the biometric options in our applications.

Thanks and regards : John Birju.

JohnBirju commented 3 years ago

Dear @Ayesh02 , In our application we are also facing same issue ( on Android above mentioned method always return touch id, even the Face id enabled on device) could you please help me, if you have the solution for that issue.

Thanks and regards: John.

AnEnglishmanInNorway commented 3 years ago

Hi First of all - I have been using Plugin.Fingerprint for some years and am most happy to be able to rely on it, thank you! I am now trying to upgrade to 2.1.1 and having a little trouble with one device, on which more later. First, my environment: Platforms on which I currently have my app operational are:

I use Visual Studio 2019 Community Edition on Windows 10 as my development environment. I currently have Android 10.0 (Q, API 29) as my target framework when I build, but set a minimum version as Android 6.0 (Marshmallow, API 23) For Android I test first using Visual Studio's Android emulators configured for the various API levels (and with a fingerprint sensor enabled). Then I attach the physical phones which are most important to me, usually just the two I have in use myself, and check them using USB debugging. In all cases the OS and the Nuget packages on which I rely are the latest as of today's date (I have updated the app regularly as updates have become available) The one exception to my "keep everything up to date" rule has been Plugin.Fingerprint, where I have stayed with 1.4.9. Now I am attempting to update to 2.1.1. Things are mostly good after the update:

Perhaps somebody might have some idea of what might be the issue. I know Samsung have been a bit special in the past with the WRITE_USE_APP_FEATURE_SURVEY permission they require (and which I have set in my manifest).