![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@corupta/react-native-mrz-reader
Advanced tools
Reads MRZ field for React Native (Both iOS and Android)
IOS Version only supports TD3 format Passport MRZ (doesn't support id cards), and only supports back camera. Android Version only reads document number, expiry date, birth date, and fills rest of the fields empty.
Install the Plugin:
npm install react-native-mrz-reader
Link Native Modules (if required for versions below React Native 0.60):
npx react-native link react-native-mrz-reader
iOS Additional Setup: Modify your Info.plist to include necessary Camera usage descriptions.
<key>NSCameraUsageDescription</key>
<string>This app requires Camera access to verify your identity.</string>
Android Additional Setup: Add Camera permissions in your AndroidManifest.xml.
<uses-feature android:name="android.hardware.camera" android:required="false" />
<uses-permission android:name="android.permission.CAMERA" />
Add the following code in your app to request camera permission at runtime:
import { Platform} from 'react-native';
import * as Permissions from 'react-native-permissions';
async function requestCameraPermission() {
try {
const granted = await Permissions.request(
(() => {
switch(Platform.OS) {
case 'ios':
return Permissions.PERMISSIONS.IOS.CAMERA;
case 'android':
return Permissions.PERMISSIONS.ANDROID.CAMERA;
default:
throw new Error(`Unsupported platform: ${Platform.OS}`);
}
})(),
{
title: 'Camera Permission',
message: 'This app needs access to your camera to scan MRZ.',
buttonNeutral: 'Ask Me Later',
buttonNegative: 'Cancel',
buttonPositive: 'OK',
}
);
switch(granted) {
case Permissions.RESULTS.GRANTED:
case Permissions.RESULTS.LIMITED:
console.log('You can use the camera');
break;
default:
console.log('Camera permission denied');
break;
}
} catch (err) {
console.warn(err);
}
}
Note: This plugin is currently only available for Android devices.
import MrzReader, { CameraSelector, DocType } from 'react-native-mrz-reader';
// ...
<MrzReader
style={{width: '100%', height: '100%'}}
docType={DocType.Passport}
cameraSelector={CameraType.Back}
onMRZRead={(mrz: string) => {
console.log(mrz)
}}
/>
For a detailed example of how to use the NFC Passport Reader, please see the Example App.
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
Made with create-react-native-library
IOS Version is implemented via Vision API by @corupta following the base implementation from girayk/MrzScanner
FAQs
Reads MRZ field for React Native
We found that @corupta/react-native-mrz-reader demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.