Closed patrikengborg closed 4 years ago
@EddyVerbruggen any idea? Would really appreciate some help on this one. Thanks.
Can you start by mentioning which platform(s) and perhaps share a repo I can look at?
Hi @EddyVerbruggen ,
Thanks for getting back, and sorry about inadequate info.
The platform is iOS, and instead of publishing the whole repo I will try to give you a simplified code sample below.
import { FingerprintAuth } from 'nativescript-fingerprint-auth'
const fingerprintAuth = new FingerprintAuth()
async function auth() {
try {
const result = await fingerprintAuth.verifyFingerprint()
// Fingerprint auth succeeded
} catch (error) {
// Fingerprint auth failed
}
}
auth()
My problem is that I can only detect if the fingerprint verification succeeds or fails. In my case, I need to perform a redirect if the user taps the cancel button. In that case the verifyFingerprint
function neither succeeds or fails.
So is there a cancel event to listen for or any other way to know that the user tapped cancel?
I hope I was able to give you a better description now.
Thank you.
Hi, that's very clear indeed, thanks! I don't think it's possible for me to know whether that function failed or was cancelled, but perhaps if you use verifyFingerprintWithCustomFallback
you may get the relevant details in the reject
(or catch
in your case) because of this line.. can you give that a shot?
Yes!
{ code: -2, message: 'Canceled by user.' }
Brilliant, thank you so much!
After invoking the
verifyFingerprint
function and the user presses cancel - How do I catch that cancel event / press?Thanks.