capacitor-biometric-auth
capacitor-biometric-auth copied to clipboard
Interface 'CapacitorInstance' incorrectly extends interface 'CapacitorGlobal'
Hi, I'm getting folloing exception when trying to use this plugin.
Please help anyone
Exception: ] Error: node_modules/@capacitor/core/types/definitions-internal.d.ts:16:18 - error TS2430: Interface 'CapacitorInstance' incorrectly extends interface 'CapacitorGlobal'. [ng] Types of property 'Plugins' are incompatible. [ng] Property 'BiometricAuth' is missing in type '{ [pluginName: string]: { [prop: string]: any; }; }' but required in type 'PluginRegistry'. [ng] 16 export interface CapacitorInstance extends CapacitorGlobal { [ng] ~~~~~~~~~~~~~~~~~ [ng] node_modules/capacitor-biometric-auth/dist/esm/definitions.d.ts:3:9 [ng] 3 BiometricAuth: BiometricAuthPlugin; [ng] ~~~~~~~~~~~~~ [ng] 'BiometricAuth' is declared here.
Code:
import { BiometricAuth } from 'capacitor-biometric-auth';
@Component({ selector: 'app-login', templateUrl: './login.page.html', styleUrls: ['./login.page.scss'], }) export class LoginPage extends BaseComponent implements OnInit { loginModel: LoginModel; loginForm = this.fb.group({ username: [, Validators.required], password: [, Validators.required] }); showFallback = true; password = '1234'; hasBiometricAuth = false; constructor( injector: Injector, private modalController: ModalController ) { super(injector); }
async ngOnInit() { const available = await BiometricAuth.isAvailable(); this.hasBiometricAuth = available.has; if (this.hasBiometricAuth) {
}
}
async openBiometricAuth() { const authResult = await BiometricAuth.verify({ reason: 'Your session has timed out', }); if (authResult.verified) { this.dismissLockScreen(); } }
dismissLockScreen() { this.modalController.dismiss({ reset: true }); }
unLock() { if (this.password === '1234') { this.dismissLockScreen(); } }
}
I have the same issue, Still can't fix it?