import {
isSensorAvailable,
simplePrompt,
setDebugMode
} from '@sbaiahmed1/react-native-biometrics';
const authenticate = async () => {
try {
await setDebugMode(true);
const sensorInfo = await isSensorAvailable();
if (sensorInfo.available) {
console.log(`✅ ${sensorInfo.biometryType} available`);
const result = await simplePrompt('Please authenticate to continue');
if (result.success) {
console.log('🎉 Authentication successful!');
} else {
console.log('❌ Authentication failed');
}
} else {
console.log('❌ Biometric authentication not available:', sensorInfo.error);
}
} catch (error) {
console.error('💥 Authentication error:', error);
}
};