authpass / biometric_storage

Flutter plugin to store data behind biometric authentication (ie. fingerprint)
https://pub.dev/packages/biometric_storage
MIT License
183 stars 107 forks source link

[iOS] write() throws an exception when biometry is not available #101

Open martingeorgiu opened 1 year ago

martingeorgiu commented 1 year ago

When the biometry is not available on the device for some reason (the sensor is broken, or it has seen wrong face too many times, so it wants a passcode), it throws the following exception:

PlatformException (PlatformException(SecurityError, Error while writing data: -25293: The user name or passphrase you entered is not correct., null, null))

The reason is that in commit f5146678a4b23e0475bde17421e3fbffa7db2649 there is a new .biometryCurrentSet instead of the previous .userPresence, which breaks the library for such devices, resulting in an exception above.

hpoul commented 1 year ago

Maybe you can give 5.0.1-dev.1 a try. It introduces darwinBiometricOnly for StorageFileInitOptions .. When this is set to false it will use .userPresence instead of .biometryCurrentSet. https://pub.dev/packages/biometric_storage/versions/5.0.1-dev.1