Develop Secure Code
BiometricsService Constants
BiometricsService Data Types
getBiometricsService()
isAvailable()
isBiometricsReady()
checkUserIsDeviceOwner()
checkUserIsDeviceOwner(options)Verify if the user is the device owner using the device’s biometrics hardware or pin code.
1import { getBiometricsService } from 'lightning/mobileCapabilities';
2checkUserIsDeviceOwner(options: BiometricsServiceOptions): Promise<Object>;options—(Required) A BiometricsServiceOptions object to configure the BiometricsService request.A Promise object that resolves as a Boolean value. true if the user is the registered device owner and false otherwise. If an error is encountered, the error is returned via a rejected promise.
1myBiometricsService
2 .checkUserIsDeviceOwner(options)
3 .then((results) => {
4 if (result === true) {
5 console.log("✔ Current user is device owner.");
6 } else {
7 console.log("𐄂 Current user is NOT device owner.");
8 }
9 })
10 .catch((error) => {
11 console.error("Error code: " + error.code);
12 +console.error("Error message: " + error.message);
13 });See Also