我们如何与Cordova在Ionic 5/Angular中实现面部和指纹,Cordova在iOS和Android中都起作用

发布于 2025-01-18 13:27:22 字数 1077 浏览 0 评论 0原文

我使用指纹 AIO 实现了生物识别,它对于指纹工作正常,但面部身份验证不起作用,当我尝试使用面部登​​录时验证消息时会出现错误,任何解决方案都会有所帮助。

我正在使用 Ionic 5 和 Angular 8, 指纹一体机- 5.0.0 以下是我正在使用的代码,

    return this.fingerPrintAIO.show({
          clientId: 'Fingerprint-Demo',
          clientSecret: 'password', 
          disableBackup: false,
          localizedFallbackTitle: 'Use Pin',
          localizedReason: 'Please authenticate'
        });
async isFingerprintAvailable() {
    let result = false;
    const promise = await this.fingerPrintAIO.isAvailable();
    promise.then((response) => {
      if (response === "finger" || response === "face") {
      this.presentFingerPrint().then((resp: any) =>{
            console.log('Inside success');
         }).catch(e => {
               console.log('Inside failure on cancel');
            });
       }
      result = true;
      console.log('fingerprint available : ', response);
    });
    promise.catch((error) => {
      result = false;
      console.log('fingerprint error : ', error);
    });
    return result;
  }

提前致谢

I implemented Biometric with Fingerprint AIO, It works fine for Fingerprint but Face auth is not working, it gives an error while Authenticating message when I try to login using face, Any solution will be helpful.

I am using Ionic 5 with Angular 8,
Fingerprint AIO- 5.0.0
Below is the code i am using

    return this.fingerPrintAIO.show({
          clientId: 'Fingerprint-Demo',
          clientSecret: 'password', 
          disableBackup: false,
          localizedFallbackTitle: 'Use Pin',
          localizedReason: 'Please authenticate'
        });
async isFingerprintAvailable() {
    let result = false;
    const promise = await this.fingerPrintAIO.isAvailable();
    promise.then((response) => {
      if (response === "finger" || response === "face") {
      this.presentFingerPrint().then((resp: any) =>{
            console.log('Inside success');
         }).catch(e => {
               console.log('Inside failure on cancel');
            });
       }
      result = true;
      console.log('fingerprint available : ', response);
    });
    promise.catch((error) => {
      result = false;
      console.log('fingerprint error : ', error);
    });
    return result;
  }

Thanks in Advance

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文