Tuesday, November 27, 2018

Using finger touch with this function

function isAuthUsingTouchSupported()
{
var status = kony.localAuthentication.getStatusForAuthenticationMode(constants.LOCAL_AUTHENTICATION_MODE_TOUCH_ID);
if(status == 5000)
{
   
        alert("Touch ID for FingerPrint Sample ");
authUsingTouchID();
}

  else
{
var msg = "Touch ID is not configured on this device.Authentication returned a status ::"+status;
kony.ui.Alert({message: msg+" "+status,
alertType: constants.ALERT_TYPE_INFO,
yesLabel:"Close"},
{});
}
}




function statusCB(status,message)
{

if(status == 5000)
{
   
      frmAddAccount.show();
   
}

  else if(status == 5001)
      {
   
       alert("try again");
      }
  else
{
var messg = status+": "+message;
kony.ui.Alert({message: messg,
alertType: constants.ALERT_TYPE_INFO,
yesLabel:"Close"},
{});
}
}



function authUsingTouchID()
{
 
  var config = {"promptMessage" : "PLEASE AUTHENTICATE USING YOUR TOUCH ID"};
kony.localAuthentication.authenticate(
constants.LOCAL_AUTHENTICATION_MODE_TOUCH_ID,statusCB,config);
}






0 comments:

Post a Comment