ionic-lockscreen
v1.0.1
Published
A pin code lock screen for ionic cordova mobile apps
Downloads
12
Maintainers
Readme
ionic-lockscreen
Features
- Supports Touch ID on iOS using cordova-plugin-touchid
- Customizable
Install
NPM
$ npm install ionic-lockscreen --save
Bower
$ bower install ionic-lockscreen --save
Use
Include as a dependency in your angular module
angular.module('myApp', ['ionic-lockscreen'])
Add the directive as the first element in your app container element:
<body ng-app="myApp">
<lock-screen></lock-screen>
...
</body>
Load whenever the app is opened:
.run(['$lockScreen', $ionicPlatform, function($lockScreen, $ionicPlatform) {
$ionicPlatform.ready(function() {
$lockScreen.show({
code: '1234',
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:
$lockScreen.show({
code: '1234',
ACDelbuttons: true,
});
Hide lockscreen if needed:
$lockScreen.hide();
You can also trigger the lock screen on the resume and pause events.
Touch ID (iOS only)
Install cordova-plugin-touchid
$ cordova plugin add cordova-plugin-touchid --save
Set touchId:true
$lockScreen.show({
code: '1234',
touchId: true,
});
Theming / Language
See available options here.
Contributing
Build
npm i
gulp
License
MIT