sjhoeksma / cordova-plugin-keychain-touch-id

Touch ID plugin with saving password in keychain for IOS and android
88 stars 160 forks source link

Please share UI template and Script? #1

Closed ankushgoyal27 closed 8 years ago

ankushgoyal27 commented 8 years ago

Hi,

Its a very nice tutorial. If possible, please share the HTML templates and script file.

Thanks.

Ankush

sjhoeksma commented 8 years ago

Hi, I did not create a full working example and the project where I use it myself is private. But the readme should give you enough to start and perhaps the pointers will help.

You can only check cordova function when the document is fully loaded. When using for example the ionic framework this can be done by creating a function

$ionicPlatform.ready(function () {
  if (window.plugins) {
    window.plugins.touchid.isAvailable(function(){
      window.plugins.touchid.has("MyKey",function(){
         window.plugins.touchid.verify("MyKey","My Message",function(password){
             alert("Tocuh " + password);
     });
       },function(){
     alert("Touch ID available but no Password Key available");
    },function(msg){
    alert("no Touch ID available");
  })}
}