I tried to use Android Fingerprint Auth like shown in the docs. My code has only very few changes. I put the following lines inside platform.ready().then… in app.components.ts:
// Test AndroidFingerprintAuth
this.androidFingerprintAuth.isAvailable()
.then((result)=> {
console.log(JSON.stringify(result));
if(result.isAvailable){
// it is available
this.androidFingerprintAuth.encrypt({ clientId: "testAndroidFingerprint", username: "test", password: "pa$$w0rd" })
.then(result => {
if (result.withFingerprint) {
console.log("Successfully encrypted credentials.");
console.log("Encrypted credentials: " + result.token);
} else if (result.withBackup) {
console.log('Successfully authenticated with backup password!');
} else console.log('Didn\'t authenticate!');
})
.catch(error => {
if (error === "Cancelled") {
console.log("Fingerprint authentication cancelled");
} else console.error(error)
});
} else {
// fingerprint auth isn't available
console.log('fingerprint auth is not available');
}
})
.catch(error => console.error(error));
My problem is, that I’m getting - when testing on a Samsung Note 4 (which has a fingerprintscanner) - as result the following:
{"isAvailable":false,"isHardwareDetected":false,"hasEnrolledFingerprints":false}
Can you help me? I can’t see any errors because I’m following strictly the docs.