I try to use TouchID, but this.touchId.isavaliable()
always go into err
. I test on my actual iPhone 7.
Here is my code
import { TouchID } from '@ionic-native/touch-id';
constructor(private touchId: TouchID){}
In my touch_id_login()
this.touchId.isAvailable().then(res=>{
this.touchId.verifyFingerprint('Scan your finger')
.then(
res => {
let load = this.loadCtrl.create({
content: "Login...",
spinner: "crescent"
});
load.present();
this.loginAPI.login(user).subscribe(data=>{
if(data.success){ this.db.set('username', this.username); load.dismiss(); this.navCtrl.setRoot(TabsPage); }else if(!data.success){ if(data.msg == 'no_user'){ load.dismiss(); this.showToast('no user'); return; } } })},
err => {this.showToast('fail');}
);
}, err=>{
this.showToast('TouchID unavaliable');
})
I really cant figure it out, please help