我相信FingerprintAIO
可能不支持插件ionic 4
。
当我使用以下命令安装cordova
和ionic
插件时,一切似乎都很好:
ionic cordova plugin add cordova-plugin-fingerprint-aio
npm install @ionic-native/fingerprint-aio
在我的app.module.ts
中,我有以下代码:
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { RouteReuseStrategy } from '@angular/router';
import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
import { StatusBar } from '@ionic-native/status-bar/ngx';
import { AppComponent } from './app.component';
import { AppRoutingModule } from './app-routing.module';
import {FingerprintAIO} from '@ionic-native/fingerprint-aio';
@NgModule({
declarations: [AppComponent],
entryComponents: [],
imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule],
providers: [
StatusBar,
SplashScreen,
{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy },
FingerprintAIO
],
bootstrap: [AppComponent]
})
export class AppModule {}
但是我在哪里列出FingerprintAIO作为提供者,却出现以下错误:
TS2322: Type 'FingerprintAIOOriginal' is not assignable to the type 'Provider'. Type 'FingerprintAIOOriginal' is not assignable to the type 'FactoryProvider'. Property 'provide' is missing in type 'FingerprintAIOOriginal'
任何想法是什么原因造成的?有其他选择吗?
答案 0 :(得分:2)
从
更改导入import {FingerprintAIO} from '@ionic-native/fingerprint-aio';
到
import {FingerprintAIO} from '@ionic-native/fingerprint-aio/ngx';
如official docs的用法部分所述