This plugin aim to provides a single and simple interface for accessing keychain from iOS devices using biometrics verification.
In order to access and persist data to your keychain using biometrics verification, you will need to check whether your device is available with biometry.
window.plugins.keychain.isAvailable(
function(type) {alert(type)}, // success callback: biometrics type 'face' or 'touch'
function(error) {alert(msg)} // error callback: biometrics.not_available
);
Check whether key existed
window.plugins.keychain.has(
'cdov', // key
function(){alert(true)}, // success callback
function(error){alert(error)} // error callback: user.not_found
);
window.plugins.keychain.save(
'cdov', // key
'password', // data
true, // authentication required if true will required biometrics verification to perform this operation
function(){alert(true)}, // success callback
function(error){alert(error)} // error callback: user.not_found
);
window.plugins.keychain.verify(
'cdov', // key
'message', // authentication UI prompted message
function(data){alert(data)}, // success callback: with data return
function(error){alert(error)} // error callback
);
window.plugins.keychain.delete(
'cdov', // key
function(){alert(true)}, //success callback
function(error){alert(error)} //error callback
);