ionic-framework - 无法在 Ionic 4 中设置指纹选项 - 指纹 AIO
问题描述
我正在尝试在 Ionic 4 中使用 FingerPrint AIO 本机功能。我已按照指南(https://ionicframework.com/docs/native/fingerprint-aio)设置并运行它,但没有 FingerPrintOptions。
如果我像这样将“显示”对象保持为空: show({}) 它工作正常,但如果我尝试添加诸如:clientId、clientSecret 等选项,我会收到错误消息。
我有以下代码:
代码
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));
我究竟做错了什么?为什么我无法添加指纹选项?
没有fingerPrintOptions 的代码在Iphone 8(FingerPrint、Passcode)和Iphone X(Face ID)上工作和测试。
解决方案
我在节点模块中检查了那些选项在 FingerprintOptions 中不可用,而是这是结构
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));
推荐阅读
- sql - 创建一个从另一个表导入的按时间排序的过程?
- javascript - 通过微前端方法的脚本标签加载 webpack 包
- google-compute-engine - GCE Windows Server 自动关闭
- java - 如何在不使用数组、split() 或 StringBuilder 的情况下逐字反转字符串
- r - R 函数创建
- r - R中的返回水平
- java - 将列表作为结果返回到方法通道会引发 java.lang.illegalArgumentException?
- html - 不同的浏览器/设备如何处理字体粗细?
- json - 删除 mule 4 dataweave 转换中的反斜杠
- java - 你如何使用 Spring RestDocs 来记录 WebFlux 响应的字段?