import { Component, OnInit } from '@angular/core';
import { AnimationController, ModalController } from '@ionic/angular';
import { BadRequestPage } from '../popover/bad-request/bad-request.page';
import { SuccessMessagePage } from '../popover/success-message/success-message.page';
// import { FingerprintAIO } from '@ionic-native/fingerprint-aio';

@Component({
  selector: 'app-fingerprint',
  templateUrl: './fingerprint.page.html',
  styleUrls: ['./fingerprint.page.scss'],
})
export class FingerprintPage implements OnInit {

  constructor( private modalController: ModalController,
    //private faio: FingerprintAIO
    private animationController: AnimationController
    ) { 
  }

  ngOnInit() {
  }

  login() {
    
    // this.faio.show({
    //   clientId: 'Fingerprint-Demo',
    //   clientSecret: 'password', //Only necessary for Android
    //   disableBackup:true,  //Only for Android(optional)
    //   localizedFallbackTitle: 'Use Pin', //Only for iOS
    //   localizedReason: 'Please authenticate' //Only for iOS
    // })
    // .then((FingerPrintHash: any) => {
    //   console.log(FingerPrintHash)

    //   const storedFinderPrint =  localStorage.getItem('FingerPrintHash')
    //   if(FingerPrintHash == storedFinderPrint) {

    //   }

    // })
    // .catch((error: any) => {
    //   console.log(error)
    // });
  }

  close() {
    /* console.log(this.isEventEdited); */
    this.modalController.dismiss();
  }

   async save() {

    // this.faio.show({
    //   clientId: 'Fingerprint-Demo',
    //   clientSecret: 'password', //Only necessary for Android
    //   disableBackup:true,  //Only for Android(optional)
    //   localizedFallbackTitle: 'Use Pin', //Only for iOS
    //   localizedReason: 'Please authenticate' //Only for iOS
    // })
    // .then((FingerPrintHash: any) => {
      
    //   this.toastService.successMessage()
    //   localStorage.setItem('FingerPrintHash', FingerPrintHash)

    // })
    // .catch((error: any) => {
    //   this.toastService.badRequest()
    // });

}

}