
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
react-native-biometric-check
Advanced tools
The integration of biometric authentication, such as fingerprint and Face ID, adds a layer of security and convenience to mobile applications. This package streamlines the implementation process across iOS and Android platforms, ensuring a consistent user experience. By following the provided instructions, developers can easily leverage biometric authentication to enhance the security and usability of their applications. With tailored permissions and platform-specific logic, this solution caters to the diverse needs of modern mobile development.
<key>NSFaceIDUsageDescription</key>
<string>We use Face ID to secure your account.</string>
<uses-permission android:name="android.permission.USE_BIOMETRIC" />
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
To use the provided code snippet with the react-native-biometric-check library, you'll need to follow these steps:
Install the library:
npm i react-native-biometric-check
Import the necessary functions and modules in your component:
import { enableBioMetric, checkBiometricSupport, checkNewFingerPrintAdded } from 'react-native-biometric-check';
Implement the authentication logic in your component, preferably within a useEffect hook:
useEffect(() => {
checkNewFingerPrintAdded((res) => {
if (res === "NEW_FINGERPRINT_ADDED") {
Alert.alert("Alert", res);
}
});
if (Platform.OS === "ios") {
enableBioMetric("Use passcode", "Enter phone screen lock pattern, PIN, password or fingerprint", (res) => {
switch (res) {
case 1:
Alert.alert("Alert", "Biometric authentication not available on the device");
break;
case 2:
Alert.alert("Alert", "Biometric authentication is locked due to too many failed attempts");
break;
case 3:
Alert.alert("Alert", "Biometric authentication is not enrolled");
break;
case 4:
Alert.alert("Alert", "BIOMETRIC_STATUS_UNKNOWN");
break;
case 5:
Alert.alert("Success", "Verified successfully");
break;
default:
Alert.alert("Error", `${res}`);
}
});
return;
}
checkBiometricSupport((res) => {
if (res === "SUCCESS") {
enableBioMetric("Biometric", "Enter phone screen lock pattern, PIN, password or fingerprint", (res) => {
Alert.alert("Status", `${res}`);
});
} else {
Alert.alert("Alert", res);
}
});
}, []);
Ensure your info.plist for iOS and AndroidManifest.xml for Android are properly configured with the required permissions as mentioned earlier.
Test your application to verify the functionality of biometric authentication on both iOS and Android devices.
Remember to handle any errors or edge cases specific to your application's requirements.
Certainly! Here's the combined explanation with all the points included:
Usage of checkNewFingerPrintAdded Function:
checkNewFingerPrintAdded function is utilized to verify whether new biometric data has been added at the device level."NEW_FINGERPRINT_ADDED".Platform Check (iOS):
Platform.OS === "ios".enableBioMetric function.Handling Response (iOS):
enableBioMetric function, it uses a switch statement to handle different cases.Return Statement (iOS):
return; statement ensures that the function exits early if the platform is iOS, as there's no need to proceed with the Android-specific logic.Biometric Support Check (Android):
checkBiometricSupport function.res === "SUCCESS"), it proceeds to enable biometric authentication similarly to iOS.Handling Response (Android):
enableBioMetric function on Android, it shows the status of biometric verification in an alert dialog.Error Handling (Android):
This combined explanation covers the usage of the checkNewFingerPrintAdded function and the implementation of biometric authentication for both iOS and Android platforms, including handling different scenarios and responses accordingly.
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
Made with create-react-native-library
FAQs
react native biometric
We found that react-native-biometric-check demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.