mjwheatley / cordova-plugin-android-fingerprint-auth

A cordova plugin for fingerprint authentication using the hardware fingerprint scanner on devices running Android 6+
Apache License 2.0
168 stars 131 forks source link

There should be hide() function #21

Closed razam217 closed 5 years ago

razam217 commented 8 years ago

There should be a FingerprintAuth.hide() method to hide the dialog.

mjwheatley commented 8 years ago

Please provide a use case. Why would you need to hide the dialog?

razam217 commented 8 years ago

When I resume my app, it asks me for the touchID and I do not enter it also I do not cancel and directly move the app to background state. Now when I resume my app, it first shows error on touchID dialog i.e. 'Finger print not recognized try again.' and then opens another dialog without that error, but that does not respond when I try to enter touchID.

mjwheatley commented 8 years ago

That would be an implementation error and not an issue with the plugin. If your application goes into the background while the dialog is open, the expectation would be that the dialog would still be open when your application resumes. The problem is that you are triggering the dialog to open in on resume, so your app is trying to open a second dialog, which is causing a problem.

You should set a flag in your app to indicate if the dialog has been open and save that state when your application goes to the background. In on resume, if that flag indicates that the dialog is open, do not try to show another dialog.

razam217 commented 8 years ago

Thanks a lot, that really helped. It was an implementation error.

lxAppDev commented 7 years ago

Following Use case:

mknauer commented 5 years ago

Can we re-open this issue somehow? And if necessary, we'd be happy to contribute a change...

Our use case is a bit complex. Imagine an app where external events (e.g. push notifications) are controlling, which authentication methods (fingerprint or password) are permitted.

Let's assume a push notification arrives that allows using a fingerprint for authentication. The app opens and we show the fingerprint dialog, because that is what the incoming push notification tells us to do.

Unfortunately the user decides to ignore that, and triggers another event that again leads to opening the app. But this time, fingerprint is not permitted, the app unlock must only be possible by entering the password. In this case, the fingerprint dialog is still showing up but should be closed...

Do you understand that there are thinkable use cases that can only be solved by programmatically closing the dialog?

mjwheatley commented 5 years ago

Understood. I have a local branch where I implemented the hide() method. I will merge that branch and push a new version for you to test.

mjwheatley commented 5 years ago

Actually I named it dismiss()

mjwheatley commented 5 years ago

I have published version 1.5.0

mknauer commented 5 years ago

Wow, I'm impressed! Thanks, we'll be testing the new version.