react-native-local-authenticate
react-native-local-authenticate copied to clipboard
Not working on Android
I call this function at the start of my app:
import {RNLocalAuthenticate} from 'react-native-local-authenticate';
const localAuth = async () => {
try {
const hasHardware = await RNLocalAuthenticate.HasHardware();
console.log('hasHardware', hasHardware);
if (!hasHardware) {
await afterLoginFlow();
return;
}
} catch (err) {}
try {
const isAuth = await RNLocalAuthenticate.Authenticate('reason');
console.log('isAuth', isAuth);
if (isAuth) {
await afterLoginFlow();
} else {
localAuth();
}
} catch (err) {
console.log('err', err);
await localAuth();
}
};
It works fine on IOS (except for #4 ), but on Android nothing is happening. I just get false
from the Authenticate call.
I've added this to my AndroidManifest.xml:
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.USE_BIOMETRIC" />
Did you found a solution?