There's an issue making onNeedUnlock is called over and over again.
Reproduce:
Run the example
Install local_auth
Modify onNeedUnlock as below
onNeedUnlock: (secure) async {
print(
'need unlock maybe use biometric to confirm and then sercure.unlock() or you can use the lockedBuilder');
try {
final LocalAuthentication auth = LocalAuthentication();
var authResult = await auth.authenticate(
localizedReason: 'ZZZ',
options: AuthenticationOptions(
biometricOnly: false,
),
);
if (authResult) {
secure?.unlock();
return SecureApplicationAuthenticationStatus.SUCCESS;
}
else {
return SecureApplicationAuthenticationStatus.FAILED;
}
} catch (e) {
return SecureApplicationAuthenticationStatus.FAILED;
}
return null;
},
If the app asks for FaceID => face not matched => Cancel => onNeedUnlock is called over and over.
This is because of appstate changed to resumed when face id is dismissed.
I don't know this is a bug or not, but I
think onNeedUnlock should not work like that. Currently I put a small delay after .authenticate() to workaround this.
There's an issue making onNeedUnlock is called over and over again.
Reproduce:
Modify onNeedUnlock as below
This is because of appstate changed to
resumed
when face id is dismissed. I don't know this is a bug or not, but I think onNeedUnlock should not work like that. Currently I put a small delay after .authenticate() to workaround this.Screen recording: https://github.com/neckaros/secure_application/assets/7337535/439df9c6-1a0d-4a95-ba0a-3e12d0ed18ea