touchid
v0.0.14
Published
touch id plugin which will help ios user to login with touch id
Downloads
6
Maintainers
Readme
TouchID Plugin
This is a fingerprint plugin build for iOS version greater than 8. We will try to extend the functionality for android in later phase.
Note: -
1)Minimum iOS version is 8. It will return error callbacks on lower versions.
2)Requires a fingerprint scanner, so an iPhone 5S or newer is required.
Automatically (CLI):
From npm:
$ cordova plugin add cordova-plugin-touch-id
$ cordova prepare
From git: Still not hosted this project on github. We will do it later.
Manually
1. Add the following xml to your config.xml in the root directory of your www folder:
<feature name="touchid">
<param name="ios-package" value="touchid" />
</feature>
You'll have to add the LocalAuthentication.framework and Security.framework to your project.
2. Copy touchid.js, add it to your project and reference it in index.html:
<script type="text/javascript" src="js/touchid.js"></script>
3. Download the source files and copy them to your project.
iOS: Copy the two .h and two .m files to platforms/ios/<ProjectName>/Plugins
Usage
This plugin contains 2 method
1) isAvailable :- This method will help to find if the device is having touch id support.
window.plugins.touchid.isAvailable(
successCallBack, // success handler: touchid available
errorCallBack // error handler: no touchid available
);
2) verifyFingerprint :- This method should be called to verify finger print. The plugin fallback option called 'enter passcode' which shows the default passcode UI when pressed. First parameter is the title to the pop.
window.plugins.touchid.verifyFingerprint(
'please Scan your fingerprint ', // this will be shown in the native scanner popup
successCallBack, // success handler: fingerprint accepted
errorCallBack// error handler with errorcode and localised reason
);
function successCallBack(msg) {
alert('ok: ' + msg)
}
function errorCallBack(msg) {
alert('not ok: ' + JSON.stringify(msg))
}