ionic-lockscreen

1.0.1 • Public • Published

ionic-lockscreen

Features

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

Package Sidebar

Install

npm i ionic-lockscreen

Weekly Downloads

0

Version

1.0.1

License

MIT

Last publish

Collaborators

  • pavelety