Reputation: 2609
I am trying to using FingerPrint AIO native feature in Ionic 4. I have got it setup and running by following the guide (https://ionicframework.com/docs/native/fingerprint-aio) but without FingerPrintOptions.
If I keep the "show" object empty like this: show({}) it works fine but if I try to add option such as: clientId, clientSecret,... I get error.
I have below code:
this.faio.show({
clientId: 'Fingerprint-Demo',
clientSecret: 'o7aoOMYUbyxaD23oFAnJ'
disableBackup:true,
localizedFallbackTitle: 'Use Pin',
localizedReason: 'Please authenticate'
})
.then((result: any) => console.log(result))
.catch((error: any) => console.log(error));
ERROR in src/app/pages/login/login.page.ts(211,7): error TS2322: Type '{ clientId: string; clientSecret: string; disableBackup: true; localizedFallbackTitle: string; localizedReason: string; }' is not assignable to type 'FingerprintOptions'.
Object literal may only specify known properties, and 'clientId' does not exist in type 'FingerprintOptions'.
this.faio.show({})
.then((result: any) => console.log(result))
.catch((error: any) => console.log(error));
What am I doing wrong? Why I am unable to add FingerPrintOptions?
The code without fingerPrintOptions is working and tested on Iphone 8 (FingerPrint, Passcode) and Iphone X (Face ID).
Upvotes: 1
Views: 1383
Reputation: 31
I checked in node modules those options are not available in FingerprintOptions instead this is the structure
this.faio.show({
title: 'Biometric Authentication', // (Android Only) | optional | Default: "<APP_NAME> Biometric Sign On"
subtitle: 'Coolest Plugin ever' // (Android Only) | optional | Default: null
description: 'Please authenticate' // optional | Default: null
fallbackButtonTitle: 'Use Backup', // optional | When disableBackup is false defaults to "Use Pin".
// When disableBackup is true defaults to "Cancel"
disableBackup:true, // optional | default: false
})
.then((result: any) => console.log(result))
.catch((error: any) => console.log(error));
Upvotes: 3