onymosBioAuth.isAvailable
Checks if any bio-authentication capabilities are available on the device (e.g., touch-id, face-id, etc)
function isAvailable () {
OnymosBioauth.isAvailable(
function isAvailableSuccess (bioauthAvailable, bioauthTypeObject) {
/* ------
bioauthAvailable: Boolean. Whether bioauth can be used on device
bioauthTypeObject = {
bioauthType: The type of biometrics the device uses. May be "face" or "touch". Available in iOS devices only.
};
------ */
},
function isAvailableFailure (error) {
console.log(error);
});
} /* end function isAvailable */
onymosBioAuth.authenticate
Prompts user for authentication and authenticates using bioauth.
function authenticate () {
OnymosBioauth.authenticate(
function authenticateSuccess (status) {
/* ------
status: String. The status of a successful authentication, "success".
------ */
},
function authenticateFailure (error) {
console.log(error);
},
options);
} /* end function authenticate */
options
disableFallback
Default: false
Specifies whether to remove device credential backup option on authentication dialogue. If true, the device’s system fallback will not be used.
title
Default: “APP_NAME Biometric Authentication”
Title in authentication dialogue. Only for use with Android devices.
subtitle
Default: “Log in using your biometric credentials”
Subtitle in authentication dialogue. Only for use with Android devices.
description
Default: “Authentication”
Description in authentication dialogue.
fallbackText
Default: “Enter Passcode”
Title of fallback button. Only used when disableFallback is false. Only for use with iOS devices.
negativeButtonText
Default: “Cancel”
Title of negative/cancel button. Only used when ‘disableFallback’ is true. May be used specify cancel or fallback action. Only for use with Android devices.
confirmationRequired
Default: false
Specifies whether user confirmation is required after biometric authentication. Only for use with Android devices.
Usage Example
1.
{
disableFallback: false,
title: ‘Bioauth Login’,
subtitle: ‘Login with with Bioauth’,
description: ‘Confirm Authorization’,
fallbackText: ‘Enter PIN’,
confirmationRequired: false
}
2.
{
disableFallback: true,
title: ‘Bioauth Login’,
subtitle: ‘Login with with Bioauth’,
description: ‘Confirm Authorization’,
negativeButtonText: ‘Back’
confirmationRequired: false
}