react-native-ocr-package
Version:
A React component for scanning National Identity cards using a device's camera. This package integrates OCR technology to extract the text data from scanned cards by making API calls.
27 lines (24 loc) • 806 B
JavaScript
import { NativeModules, Platform } from 'react-native';
const { LivenessDetectionModule } = NativeModules;
export default {
/**
* Start the face liveness detection process
* @returns {Promise<Object>} Promise resolving to liveness detection results
*/
startLivenessDetection: () => {
if (Platform.OS !== 'android') {
return Promise.reject(new Error('Liveness detection is only available on Android'));
}
return LivenessDetectionModule.startLivenessDetection();
},
/**
* Check if liveness detection is available on this device
* @returns {Promise<boolean>} Promise resolving to availability status
*/
isAvailable: () => {
if (Platform.OS !== 'android') {
return Promise.resolve(false);
}
return LivenessDetectionModule.isAvailable();
}
};