Im using ionic 4 with angular to make an ionic fingerprint app. im using the example code from https://ionicframework.com/docs/native/fingerprint-aio. And followed all the steps. When i command out the constructor and following code the code is running when i will settup the entire code i will get a white screen with the following error:
consolelogs.js:49 ERROR Error: Uncaught (in promise): TypeError: Object(...) is not a function TypeError: Object(...) is not a function at index.js:92 at Module../node_modules/@ionic-native/fingerprint-aio/index.js (index.js:141) at webpack_require (bootstrap:84) at Module../src/app/home/home.page.ts (home-home-module.js:84) at webpack_require (bootstrap:84) at Module../src/app/home/home.module.ts (home-home-module.js:30) at webpack_require (bootstrap:84) at ZoneDelegate.invoke (zone-evergreen.js:359) at Object.onInvoke (core.js:34201) at ZoneDelegate.invoke (zone-evergreen.js:358) at resolvePromise (zone-evergreen.js:797) at resolvePromise (zone-evergreen.js:754) at zone-evergreen.js:858 at ZoneDelegate.invokeTask (zone-evergreen.js:391) at Object.onInvokeTask (core.js:34182) at ZoneDelegate.invokeTask (zone-evergreen.js:390) at Zone.runTask (zone-evergreen.js:168) at drainMicroTaskQueue (zone-evergreen.js:559)
import { FingerprintAIO } from '@ionic-native/fingerprint-aio';
@Component({
selector: 'app-home',
templateUrl: 'home.page.html',
styleUrls: ['home.page.scss'],
})
export class HomePage {
constructor(private faio: FingerprintAIO) { }
logging(){
this.faio.show({
clientId: 'Fingerprint-Demo', //Android: Used for encryption. iOS: used for dialogue if no `localizedReason` is given.
clientSecret: 'o7aoOMYUbyxaD23oFAnJ', //Necessary for Android encrpytion of keys. Use random secret key.
disableBackup:true, //Only for Android(optional)
localizedFallbackTitle: 'Use Pin', //Only for iOS
localizedReason: 'Please authenticate' //Only for iOS
})
.then((result: any) => console.log(result))
}
}
I hope anyone can help me fix the error, Because i dont understand why im getting the errror
You have two possibilities here.
First is the issue is on your import, most likely it is the one causing the error, change your import to the code below OR
import { FingerprintAIO } from '@ionic-native/fingerprint-aio/ngx';"
It's either you have not imported the plugin on your app.module.ts