Description
When using the plugin in a production build deployed via tns publish ios
the availability check seems to fail.
The code we are running and which works in a normal development build fine, are the following lines of code:
public ngOnInit() {
this.authenticate();
}
private async authenticate() {
let fSuccessful: boolean = false;
const fAvailable: BiometricIDAvailableResult = await this.fingerprintAuth.available();
if (this.secureStorageService.isFingerprintSettingEnabled() && fAvailable.any) {
try {
await this.doVerifyFingerprint();
fSuccessful = true;
} catch (e) {
trace.write("Error during fingerprint authentication: " + e, trace.categories.Debug);
}
}
if (fSuccessful) {
this.routerExtensions.navigate(["/home"], {clearHistory: true, animated: false});
} else {
this.routerExtensions.navigate(["/authenticate"], {clearHistory: true, animated: false});
}
}
private doVerifyFingerprint(): Promise<void> {
return this.fingerprintAuth.verifyFingerprintWithCustomFallback({
fallbackMessage: localize("authenticate.scanFallback"),
message: localize("authenticate.scanFinger"),
});
}
Since it is somehow very hard to get some information from a TestFlight build about what's happening, I could figure out the following error in the console.app on my mac:
-[LAClient evaluatePolicy:options:uiDelegate:reply:]_block_invoke -> (null), Error Domain=com.apple.LocalAuthentication Code=-1004 "User interaction is required." UserInfo={FingerDatabaseHash=<886d059e ec073f18 ec996a29 27374575 4d1b9c2b 42ecef54 f7b134db 335584f9>, BiometryType=1, AvailableMechanisms=(
1
), NSLocalizedDescription=User interaction is required.} on <private>
The app is not crashing but the availability functionality is not working, it seems to be false although my phone has TouchID enabled and it works fine in development builds locally.
When downgrading the plugin to version 4.0.1 it works fine for iOS, but there we have the problem of the compatibility on Android with the new nativescript version.
We would like to find a way fixing the problem but currently we're pretty lost. We don't really understand what's the difference between the local build and a TestFlight build, what happens there that could influence the plugin's functionality.
Any suggestions for the analytics or solutions of the problem?