Ionic framework 基于指纹的生物认证
我正试图通过指纹aio插件实现我的Ionic v4应用程序的身份验证 但是,当尝试使用时,出现以下错误(我正在智能手机(android)上运行应用程序): 我根据爱奥尼亚框架的官方文件进行了安装: 在app.module.ts中包含引用Ionic framework 基于指纹的生物认证,ionic-framework,plugins,ionic4,cordova-plugins,Ionic Framework,Plugins,Ionic4,Cordova Plugins,我正试图通过指纹aio插件实现我的Ionic v4应用程序的身份验证 但是,当尝试使用时,出现以下错误(我正在智能手机(android)上运行应用程序): 我根据爱奥尼亚框架的官方文件进行了安装: 在app.module.ts中包含引用 import { FingerprintAIO } from '@ionic-native/fingerprint-aio/ngx'; @NgModule({ declarations: [MyApp], imports: [ Browse
import { FingerprintAIO } from '@ionic-native/fingerprint-aio/ngx';
@NgModule({
declarations: [MyApp],
imports: [
BrowserModule,
SharedModule,
AutenticacaoModule,
AdministracaoModule,
ContaCorrenteModule,
CoreModule,
CorporativoModule,
EmprestimoModule,
InicioPageModule,
InvestimentoModule,
LoginPageModule,
TransferenciaModule,
AprovacaoModule,
ComprovanteModule,
HttpModule,
CacheModule.forRoot(),
IonicModule.forRoot(MyApp),
IonicStorageModule.forRoot()
],
bootstrap: [IonicApp],
entryComponents: [MyApp],
providers: [
StatusBar,
SplashScreen,
{ provide: ErrorHandler, useClass: IonicErrorHandler },
{ provide: LOCALE_ID, useValue: 'pt-BR' },
UtilitarioProvider,
File,
FileTransfer,
FileOpener,
AppVersion,
GerenciarTokenService,
Device,
BarcodeScanner,
SocialSharing,
Screenshot,
InAppBrowser,
FingerprintAIO
]
})
export class AppModule {}
home.ts
.
.
.
import { FingerprintAIO } from '@ionic-native/fingerprint-aio/ngx';
@IonicPage()
@Component({
selector: 'home-login',
templateUrl: 'home.html'
})
export class HomePage {
constructor(
private navCtrl: NavController,
private autenticacaoService: AutenticacaoService,
private toastCtrl: ToastController,
private loadingCtrl: LoadingController,
private usuarioService: UsuarioService,
private warmupSerice: WarmupService,
private menu: MenuController,
private utilService: UtilService,
public platform: Platform,
private appVersion: AppVersion,
private gerenciarToken: GerenciarTokenService,
private iab: InAppBrowser,
private faio: FingerprintAIO
) {
if (this.platform.is('cordova')) {
this.platform.ready().then(() => {
this.appVersion.getVersionNumber().then(ver => (this.versao = ver));
});
}
this.menu.swipeEnable(false);
}
biometric() {
try {
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) => alert(result))
.catch((error: any) => alert(error));
} catch (e) {
alert('catch ' + e);
}
}
}
我的爱奥尼亚信息
Ionic:
ionic (Ionic CLI) : 4.11.0 (C:\Users\xxxxxxx\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.2.4
Cordova:
cordova (Cordova CLI) : 9.0.0 (cordova-lib@9.0.1)
Cordova Platforms : android 9.0.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.1.3, (and 14 other plugins)
System:
Android SDK Tools : 26.1.1 (C:\Users\xxxxxxx\AppData\Local\Android\Sdk)
NodeJS : v14.16.0 (C:\Program Files\nodejs\node.exe)
npm : 6.14.11
OS : Windows 10
.
.
.
import { FingerprintAIO } from '@ionic-native/fingerprint-aio/ngx';
@IonicPage()
@Component({
selector: 'home-login',
templateUrl: 'home.html'
})
export class HomePage {
constructor(
private navCtrl: NavController,
private autenticacaoService: AutenticacaoService,
private toastCtrl: ToastController,
private loadingCtrl: LoadingController,
private usuarioService: UsuarioService,
private warmupSerice: WarmupService,
private menu: MenuController,
private utilService: UtilService,
public platform: Platform,
private appVersion: AppVersion,
private gerenciarToken: GerenciarTokenService,
private iab: InAppBrowser,
private faio: FingerprintAIO
) {
if (this.platform.is('cordova')) {
this.platform.ready().then(() => {
this.appVersion.getVersionNumber().then(ver => (this.versao = ver));
});
}
this.menu.swipeEnable(false);
}
biometric() {
try {
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) => alert(result))
.catch((error: any) => alert(error));
} catch (e) {
alert('catch ' + e);
}
}
}
ionic cordova platform add android@9.0.0
Ionic:
ionic (Ionic CLI) : 4.11.0 (C:\Users\xxxxxxx\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.2.4
Cordova:
cordova (Cordova CLI) : 9.0.0 (cordova-lib@9.0.1)
Cordova Platforms : android 9.0.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.1.3, (and 14 other plugins)
System:
Android SDK Tools : 26.1.1 (C:\Users\xxxxxxx\AppData\Local\Android\Sdk)
NodeJS : v14.16.0 (C:\Program Files\nodejs\node.exe)
npm : 6.14.11
OS : Windows 10