Ionic 4 + Angular FingerprintAIO不支持的插件吗?

时间:2019-06-11 13:26:58

标签: angular cordova ionic-framework ionic4

我相信FingerprintAIO可能不支持插件ionic 4

当我使用以下命令安装cordovaionic插件时,一切似乎都很好:

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'

任何想法是什么原因造成的?有其他选择吗?

1 个答案:

答案 0 :(得分:2)

更改导入
import {FingerprintAIO} from '@ionic-native/fingerprint-aio';

import {FingerprintAIO} from '@ionic-native/fingerprint-aio/ngx';

official docs的用法部分所述