Skip to content

carabina/ionic-lock-screen

Repository files navigation

ionic-lock-screen

Features

Install

NPM

$ npm install ionic-lock-screen --save

Bower

$ bower install ionic-lock-screen --save

Use

Include as a dependency in your angular module

angular.module('myApp', ['ionic-lock-screen'])

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)');
        },
      });
    });
}]);

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.

License

MIT

About

Passcode Lock Screen for Ionic

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published