rn-biometric-tracker
Version:
rn-biometric-tracker is a lightweight React Native library used to track biometric changes on the device. It enables you to detect when a user adds or removes biometric data (like fingerprint or face unlock) after tracking is enabled.
33 lines (31 loc) • 1.12 kB
JavaScript
;
import { NativeModules } from 'react-native';
const LINKING_ERROR = `The package 'rn-biometric-tracker' doesn't seem to be linked. Make sure: \n\n` + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
// @ts-expect-error
const isTurboModuleEnabled = global.__turboModuleProxy != null;
const RnBiometricTrackerModule = isTurboModuleEnabled ? require('./NativeRnBiometricTracker').default : NativeModules.RnBiometricTracker;
const RnBiometricTracker = RnBiometricTrackerModule ? RnBiometricTrackerModule : new Proxy({}, {
get() {
throw new Error(LINKING_ERROR);
}
});
function enableBiometric() {
return RnBiometricTracker.enableBiometric();
}
function disableBiometric() {
return RnBiometricTracker.disableBiometric();
}
function isBiometricEnabled() {
return RnBiometricTracker.isBiometricEnabled();
}
function isBiometricChanged() {
return RnBiometricTracker.isBiometricChanged();
}
const BioTrack = {
enableBiometric,
disableBiometric,
isBiometricEnabled,
isBiometricChanged
};
export default BioTrack;
//# sourceMappingURL=index.js.map