I have tested FF's own Biometric Verification, and it doesn't work, which their support has now acknowledged.
I need Biometric Verification for my app now, so I'm trying to find an alternative.
I have implemented local_auth: ^2.2.0, and it works fine on iPhone, but I can't get it to work on Android. (https://pub.dev/packages/local_auth
)
Do you have experience with local_auth: ^2.2.0 or can you see what I'm doing wrong?
Here is my code:import 'package:local_auth/local_auth.dart';
Future<bool> bioAuth() async {
// Add your function code here!
final LocalAuthentication auth = LocalAuthentication();
final bool canAuthenticateWithBiometrics = await auth.canCheckBiometrics;
final bool canAuthenticate =
canAuthenticateWithBiometrics || await auth.isDeviceSupported();
final List<BiometricType> availableBiometrics =
await auth.getAvailableBiometrics();
if (availableBiometrics.contains(BiometricType.face) ||
availableBiometrics.contains(BiometricType.fingerprint)) {
// Specific types of biometrics are available.
// Use checks like this with caution!
try {
final bool didAuthenticate = await auth.authenticate(
localizedReason: 'Please authenticate to show account balance',
options: const AuthenticationOptions(biometricOnly: true));
return didAuthenticate;
} catch (e) {
return false;
}
}
return false;
}