NiklasMerz / cordova-plugin-fingerprint-aio

Cordova Plugin for fingerprint sensors (and FaceID) with Android and iOS support
https://www.npmjs.com/package/cordova-plugin-fingerprint-aio
MIT License
320 stars 189 forks source link

iOS - isAvailable function generalize the error code, however authenticate function have proper error code mapping #226

Open jainank opened 4 years ago

jainank commented 4 years ago

Bug report

Description

For iOS application, I am calling isAvailable function when touchID is locked because of multiple invalid attempts. My expectation was that the application will return error code: case BIOMETRIC_LOCKED_OUT = -111

However it retuned: case BIOMETRIC_UNKNOWN_ERROR = -100

Environment

Platform: iOS

NiklasMerz commented 4 years ago

Looks like this error should be supported: https://github.com/NiklasMerz/cordova-plugin-fingerprint-aio/blob/8a66c24dc827dc639dfe85ffc8ef1d1418229ebc/src/ios/Fingerprint.swift#L15

I guess we need to detect it here: https://github.com/NiklasMerz/cordova-plugin-fingerprint-aio/blob/8a66c24dc827dc639dfe85ffc8ef1d1418229ebc/src/ios/Fingerprint.swift#L59

The error should be thrown correctly while using the show function?

Adding @greaterking because he is more familiar with this new iOS code.

jainank commented 4 years ago

I forked the repo, and fixed it in my local. Let me know if you want me to create PR. Happy to help!

NiklasMerz commented 4 years ago

Awesome. Of course create the PR and we will review it. Looking forward.