A rewrote and a retouched version of ionic-lock-screen [https://github.com/AlexDisler/ionic-lock-screen] for AngularJS 2 and Ionic 2.
Credit to: Alex Disler
- Supports Touch ID on iOS using cordova-plugin-touchid
Import LockScreenComponent class in the component that you want to use the lock screen
import {LockScreenComponent} from "../ionic-lock-screen/lock-screen-component";
Please ensure that you have imported NavController and initialized it
import { NavController } from 'ionic-angular';
...
constructor(public navCtrl: NavController){}
Load whenever you want to load
this.navCtrl.push(LockScreenComponent,{
code:'1234',
ACDelbuttons:true,
passcodeLabel:'Please Enter Passcode',
onCorrect:function(){
console.log('Correct!');
},
onWrong:function(attemptNumber){
console.log(attemptNumber + ' wrong passcode attempt(s)');
}
});
AC(All Clear) button and Del button is also available:
this.navCtrl.push(LockScreenComponent,{
code:'1234',
ACDelbuttons:true
});
Install cordova-plugin-touchid
$ cordova plugin add cordova-plugin-touchid --save
Set touchId:true
this.navCtrl.push(LockScreenComponent,{
code:'1234',
touchId: true,
});