BiometricModule Class
This is javacript module for taking biometric authentication. Both iOS and Android is using Fingerprint/Touch ID or Face Recognition/Face ID sensor depending on what sensor are available on the device.
You need to add a reference to "Fuse.Auth"
in your project file to use this feature.
Example
The following example shows how to use it:
```javascript
<JavaScript>
var Auth = require('FuseJS/Biometric');
var authenticate = function(e) {
if (Auth.isBiometricSupported()) {
Auth.authenticate("We need your biometric data to continue").then(function(result) {
if (result.status) {
// auth success
} else {
console.log(result.message);
}
});
}
}
module.exports = {
authenticate
};
</JavaScript>
<Panel>
<Button Text="Sign In" Alignment="Center">
<Clicked Handler="{authenticate}" />
</Button>
</Panel>
```
When Using FaceID on iOS, it is mandatory to add description about why you need authentication using FaceID. You can add the description by adding this config on your unoproj
file
"iOS": {
"PList": {
"NSFaceIDUsageDescription": "Require access to FaceID for authenticating"
}
}
Location
- Namespace
- Fuse
- Package
- Fuse.Auth 2.9.1
Interface of BiometricModule
Inherited from NativeModule
AddMember(NativeMember) uno
Reset : EventHandler (object, EventArgs) ux
Inherited from Module
Dispose uno
Evaluate(Context, ModuleResult) uno
Evaluate(Context, string) : ModuleResult uno
Evaluated : EventHandler (object, EventArgs) ux
EvaluateExports(Context, string) : object uno
GetFile : FileSource uno
Returns the file source that will be watched by the Context for changes in Fuse preview. Override in subclasses and return correct file source to support live updates in Fuse preview.