@trustchex/react-native-sdk 1.355.1 → 1.357.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -12
- package/TrustchexSDK.podspec +5 -4
- package/android/build.gradle +6 -4
- package/android/src/main/AndroidManifest.xml +1 -1
- package/android/src/main/java/com/trustchex/reactnativesdk/TrustchexSDKPackage.kt +45 -25
- package/android/src/main/java/com/trustchex/reactnativesdk/camera/TrustchexCameraManager.kt +168 -0
- package/android/src/main/java/com/trustchex/reactnativesdk/camera/TrustchexCameraView.kt +871 -0
- package/android/src/main/java/com/trustchex/reactnativesdk/mlkit/MLKitModule.kt +245 -0
- package/android/src/main/java/com/trustchex/reactnativesdk/mrz/MRZValidationModule.kt +785 -0
- package/android/src/main/java/com/trustchex/reactnativesdk/mrz/MRZValidator.kt +419 -0
- package/android/src/main/java/com/trustchex/reactnativesdk/opencv/OpenCVModule.kt +818 -0
- package/ios/Camera/TrustchexCameraManager.m +37 -0
- package/ios/Camera/TrustchexCameraManager.swift +125 -0
- package/ios/Camera/TrustchexCameraView.swift +1176 -0
- package/ios/MLKit/MLKitModule.m +23 -0
- package/ios/MLKit/MLKitModule.swift +250 -0
- package/ios/MRZValidation.m +39 -0
- package/ios/MRZValidation.swift +802 -0
- package/ios/MRZValidator.swift +466 -0
- package/ios/OpenCV/OpenCVModule.h +4 -0
- package/ios/OpenCV/OpenCVModule.mm +810 -0
- package/lib/module/Screens/Dynamic/IdentityDocumentEIDScanningScreen.js +2 -3
- package/lib/module/Screens/Dynamic/IdentityDocumentScanningScreen.js +1 -2
- package/lib/module/Screens/Dynamic/LivenessDetectionScreen.js +418 -193
- package/lib/module/Screens/Static/OTPVerificationScreen.js +11 -11
- package/lib/module/Screens/Static/QrCodeScanningScreen.js +5 -1
- package/lib/module/Screens/Static/ResultScreen.js +25 -2
- package/lib/module/Screens/Static/VerificationSessionCheckScreen.js +25 -7
- package/lib/module/Shared/Components/DebugNavigationPanel.js +234 -24
- package/lib/module/Shared/Components/EIDScanner.js +99 -9
- package/lib/module/Shared/Components/FaceCamera.js +170 -179
- package/lib/module/Shared/Components/IdentityDocumentCamera.js +2151 -771
- package/lib/module/Shared/Components/QrCodeScannerCamera.js +109 -107
- package/lib/module/Shared/Components/TrustchexCamera.js +122 -0
- package/lib/module/Shared/EIDReader/tlv/tlv.helpers.js +91 -0
- package/lib/module/Shared/EIDReader/tlv/tlv.utils.js +2 -124
- package/lib/module/Shared/EIDReader/tlv/tlvInputStream.js +4 -4
- package/lib/module/Shared/EIDReader/tlv/tlvOutputState.js +4 -4
- package/lib/module/Shared/EIDReader/tlv/tlvOutputStream.js +4 -4
- package/lib/module/Shared/Libs/analytics.utils.js +2 -2
- package/lib/module/Shared/Libs/debug.utils.js +132 -0
- package/lib/module/Shared/Libs/deeplink.utils.js +6 -5
- package/lib/module/Shared/Libs/demo.utils.js +13 -3
- package/lib/module/Shared/Libs/mrz.utils.js +1 -175
- package/lib/module/Shared/Libs/native-device-info.utils.js +12 -6
- package/lib/module/Shared/Libs/tts.utils.js +40 -6
- package/lib/module/Shared/Services/AnalyticsService.js +9 -8
- package/lib/module/Shared/Types/mrzFields.js +1 -0
- package/lib/module/Translation/Resources/en.js +87 -88
- package/lib/module/Translation/Resources/tr.js +84 -85
- package/lib/module/Trustchex.js +9 -2
- package/lib/module/index.js +1 -0
- package/lib/module/version.js +1 -1
- package/lib/typescript/src/Screens/Dynamic/IdentityDocumentEIDScanningScreen.d.ts.map +1 -1
- package/lib/typescript/src/Screens/Dynamic/IdentityDocumentScanningScreen.d.ts.map +1 -1
- package/lib/typescript/src/Screens/Dynamic/LivenessDetectionScreen.d.ts.map +1 -1
- package/lib/typescript/src/Screens/Static/OTPVerificationScreen.d.ts.map +1 -1
- package/lib/typescript/src/Screens/Static/QrCodeScanningScreen.d.ts.map +1 -1
- package/lib/typescript/src/Screens/Static/ResultScreen.d.ts.map +1 -1
- package/lib/typescript/src/Screens/Static/VerificationSessionCheckScreen.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Components/DebugNavigationPanel.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Components/EIDScanner.d.ts +2 -2
- package/lib/typescript/src/Shared/Components/EIDScanner.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Components/FaceCamera.d.ts +18 -4
- package/lib/typescript/src/Shared/Components/FaceCamera.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Components/IdentityDocumentCamera.d.ts +3 -4
- package/lib/typescript/src/Shared/Components/IdentityDocumentCamera.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Components/QrCodeScannerCamera.d.ts +2 -1
- package/lib/typescript/src/Shared/Components/QrCodeScannerCamera.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Components/TrustchexCamera.d.ts +124 -0
- package/lib/typescript/src/Shared/Components/TrustchexCamera.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/tlv/tlv.helpers.d.ts +11 -0
- package/lib/typescript/src/Shared/EIDReader/tlv/tlv.helpers.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/tlv/tlv.utils.d.ts +2 -39
- package/lib/typescript/src/Shared/EIDReader/tlv/tlv.utils.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Libs/analytics.utils.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Libs/debug.utils.d.ts +42 -0
- package/lib/typescript/src/Shared/Libs/debug.utils.d.ts.map +1 -0
- package/lib/typescript/src/Shared/Libs/deeplink.utils.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Libs/demo.utils.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Libs/http-client.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Libs/mrz.utils.d.ts +0 -4
- package/lib/typescript/src/Shared/Libs/mrz.utils.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Libs/native-device-info.utils.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Libs/tts.utils.d.ts +4 -3
- package/lib/typescript/src/Shared/Libs/tts.utils.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Services/AnalyticsService.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Types/identificationInfo.d.ts +2 -2
- package/lib/typescript/src/Shared/Types/identificationInfo.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Types/mrzFields.d.ts +11 -0
- package/lib/typescript/src/Shared/Types/mrzFields.d.ts.map +1 -0
- package/lib/typescript/src/Translation/Resources/en.d.ts +4 -5
- package/lib/typescript/src/Translation/Resources/en.d.ts.map +1 -1
- package/lib/typescript/src/Translation/Resources/tr.d.ts +4 -5
- package/lib/typescript/src/Translation/Resources/tr.d.ts.map +1 -1
- package/lib/typescript/src/Trustchex.d.ts +2 -0
- package/lib/typescript/src/Trustchex.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/version.d.ts +1 -1
- package/package.json +4 -35
- package/src/Screens/Dynamic/ContractAcceptanceScreen.tsx +1 -1
- package/src/Screens/Dynamic/IdentityDocumentEIDScanningScreen.tsx +7 -5
- package/src/Screens/Dynamic/IdentityDocumentScanningScreen.tsx +2 -3
- package/src/Screens/Dynamic/LivenessDetectionScreen.tsx +498 -216
- package/src/Screens/Static/OTPVerificationScreen.tsx +37 -31
- package/src/Screens/Static/QrCodeScanningScreen.tsx +8 -1
- package/src/Screens/Static/ResultScreen.tsx +136 -88
- package/src/Screens/Static/VerificationSessionCheckScreen.tsx +46 -13
- package/src/Shared/Components/DebugNavigationPanel.tsx +290 -34
- package/src/Shared/Components/EIDScanner.tsx +94 -16
- package/src/Shared/Components/FaceCamera.tsx +236 -203
- package/src/Shared/Components/IdentityDocumentCamera.tsx +3073 -1030
- package/src/Shared/Components/QrCodeScannerCamera.tsx +133 -127
- package/src/Shared/Components/TrustchexCamera.tsx +289 -0
- package/src/Shared/Config/camera-enhancement.config.ts +2 -2
- package/src/Shared/EIDReader/tlv/tlv.helpers.ts +96 -0
- package/src/Shared/EIDReader/tlv/tlv.utils.ts +2 -125
- package/src/Shared/EIDReader/tlv/tlvInputStream.ts +4 -4
- package/src/Shared/EIDReader/tlv/tlvOutputState.ts +4 -4
- package/src/Shared/EIDReader/tlv/tlvOutputStream.ts +4 -4
- package/src/Shared/Libs/analytics.utils.ts +48 -20
- package/src/Shared/Libs/debug.utils.ts +149 -0
- package/src/Shared/Libs/deeplink.utils.ts +7 -5
- package/src/Shared/Libs/demo.utils.ts +4 -0
- package/src/Shared/Libs/http-client.ts +12 -8
- package/src/Shared/Libs/mrz.utils.ts +1 -163
- package/src/Shared/Libs/native-device-info.utils.ts +12 -6
- package/src/Shared/Libs/tts.utils.ts +48 -6
- package/src/Shared/Services/AnalyticsService.ts +69 -24
- package/src/Shared/Types/identificationInfo.ts +2 -2
- package/src/Shared/Types/mrzFields.ts +29 -0
- package/src/Translation/Resources/en.ts +90 -100
- package/src/Translation/Resources/tr.ts +89 -97
- package/src/Translation/index.ts +1 -1
- package/src/Trustchex.tsx +21 -4
- package/src/index.tsx +14 -0
- package/src/version.ts +1 -1
- package/android/src/main/java/com/trustchex/reactnativesdk/visioncameraplugins/barcodescanner/BarcodeScannerFrameProcessorPlugin.kt +0 -301
- package/android/src/main/java/com/trustchex/reactnativesdk/visioncameraplugins/cropper/BitmapUtils.kt +0 -205
- package/android/src/main/java/com/trustchex/reactnativesdk/visioncameraplugins/cropper/CropperPlugin.kt +0 -72
- package/android/src/main/java/com/trustchex/reactnativesdk/visioncameraplugins/cropper/FrameMetadata.kt +0 -4
- package/android/src/main/java/com/trustchex/reactnativesdk/visioncameraplugins/facedetector/FaceDetectorFrameProcessorPlugin.kt +0 -303
- package/android/src/main/java/com/trustchex/reactnativesdk/visioncameraplugins/textrecognition/TextRecognitionFrameProcessorPlugin.kt +0 -115
- package/ios/VisionCameraPlugins/BarcodeScanner/BarcodeScannerFrameProcessorPlugin-Bridging-Header.h +0 -9
- package/ios/VisionCameraPlugins/BarcodeScanner/BarcodeScannerFrameProcessorPlugin.mm +0 -22
- package/ios/VisionCameraPlugins/BarcodeScanner/BarcodeScannerFrameProcessorPlugin.swift +0 -188
- package/ios/VisionCameraPlugins/Cropper/Cropper-Bridging-Header.h +0 -13
- package/ios/VisionCameraPlugins/Cropper/Cropper.h +0 -20
- package/ios/VisionCameraPlugins/Cropper/Cropper.mm +0 -22
- package/ios/VisionCameraPlugins/Cropper/Cropper.swift +0 -145
- package/ios/VisionCameraPlugins/Cropper/CropperUtils.swift +0 -49
- package/ios/VisionCameraPlugins/FaceDetector/FaceDetectorFrameProcessorPlugin-Bridging-Header.h +0 -4
- package/ios/VisionCameraPlugins/FaceDetector/FaceDetectorFrameProcessorPlugin.mm +0 -22
- package/ios/VisionCameraPlugins/FaceDetector/FaceDetectorFrameProcessorPlugin.swift +0 -320
- package/ios/VisionCameraPlugins/TextRecognition/TextRecognitionFrameProcessorPlugin-Bridging-Header.h +0 -4
- package/ios/VisionCameraPlugins/TextRecognition/TextRecognitionFrameProcessorPlugin.mm +0 -27
- package/ios/VisionCameraPlugins/TextRecognition/TextRecognitionFrameProcessorPlugin.swift +0 -144
- package/lib/module/Shared/Libs/camera.utils.js +0 -308
- package/lib/module/Shared/Libs/frame-enhancement.utils.js +0 -133
- package/lib/module/Shared/Libs/opencv.utils.js +0 -21
- package/lib/module/Shared/Libs/worklet.utils.js +0 -68
- package/lib/module/Shared/VisionCameraPlugins/BarcodeScanner/hooks/useBarcodeScanner.js +0 -46
- package/lib/module/Shared/VisionCameraPlugins/BarcodeScanner/hooks/useCameraPermissions.js +0 -35
- package/lib/module/Shared/VisionCameraPlugins/BarcodeScanner/index.js +0 -19
- package/lib/module/Shared/VisionCameraPlugins/BarcodeScanner/scanCodes.js +0 -26
- package/lib/module/Shared/VisionCameraPlugins/BarcodeScanner/types.js +0 -3
- package/lib/module/Shared/VisionCameraPlugins/BarcodeScanner/utils/convert.js +0 -197
- package/lib/module/Shared/VisionCameraPlugins/BarcodeScanner/utils/geometry.js +0 -101
- package/lib/module/Shared/VisionCameraPlugins/BarcodeScanner/utils/highlights.js +0 -60
- package/lib/module/Shared/VisionCameraPlugins/Cropper/index.js +0 -47
- package/lib/module/Shared/VisionCameraPlugins/FaceDetector/Camera.js +0 -42
- package/lib/module/Shared/VisionCameraPlugins/FaceDetector/detectFaces.js +0 -35
- package/lib/module/Shared/VisionCameraPlugins/FaceDetector/index.js +0 -4
- package/lib/module/Shared/VisionCameraPlugins/FaceDetector/types.js +0 -3
- package/lib/module/Shared/VisionCameraPlugins/TextRecognition/Camera.js +0 -56
- package/lib/module/Shared/VisionCameraPlugins/TextRecognition/PhotoRecognizer.js +0 -20
- package/lib/module/Shared/VisionCameraPlugins/TextRecognition/RemoveLanguageModel.js +0 -9
- package/lib/module/Shared/VisionCameraPlugins/TextRecognition/index.js +0 -6
- package/lib/module/Shared/VisionCameraPlugins/TextRecognition/scanText.js +0 -20
- package/lib/module/Shared/VisionCameraPlugins/TextRecognition/translateText.js +0 -19
- package/lib/module/Shared/VisionCameraPlugins/TextRecognition/types.js +0 -3
- package/lib/typescript/src/Shared/Libs/camera.utils.d.ts +0 -87
- package/lib/typescript/src/Shared/Libs/camera.utils.d.ts.map +0 -1
- package/lib/typescript/src/Shared/Libs/frame-enhancement.utils.d.ts +0 -25
- package/lib/typescript/src/Shared/Libs/frame-enhancement.utils.d.ts.map +0 -1
- package/lib/typescript/src/Shared/Libs/opencv.utils.d.ts +0 -3
- package/lib/typescript/src/Shared/Libs/opencv.utils.d.ts.map +0 -1
- package/lib/typescript/src/Shared/Libs/worklet.utils.d.ts +0 -9
- package/lib/typescript/src/Shared/Libs/worklet.utils.d.ts.map +0 -1
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/hooks/useBarcodeScanner.d.ts +0 -13
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/hooks/useBarcodeScanner.d.ts.map +0 -1
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/hooks/useCameraPermissions.d.ts +0 -6
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/hooks/useCameraPermissions.d.ts.map +0 -1
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/index.d.ts +0 -12
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/index.d.ts.map +0 -1
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/scanCodes.d.ts +0 -3
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/scanCodes.d.ts.map +0 -1
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/types.d.ts +0 -52
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/types.d.ts.map +0 -1
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/convert.d.ts +0 -62
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/convert.d.ts.map +0 -1
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/geometry.d.ts +0 -34
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/geometry.d.ts.map +0 -1
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/highlights.d.ts +0 -32
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/highlights.d.ts.map +0 -1
- package/lib/typescript/src/Shared/VisionCameraPlugins/Cropper/index.d.ts +0 -23
- package/lib/typescript/src/Shared/VisionCameraPlugins/Cropper/index.d.ts.map +0 -1
- package/lib/typescript/src/Shared/VisionCameraPlugins/FaceDetector/Camera.d.ts +0 -9
- package/lib/typescript/src/Shared/VisionCameraPlugins/FaceDetector/Camera.d.ts.map +0 -1
- package/lib/typescript/src/Shared/VisionCameraPlugins/FaceDetector/detectFaces.d.ts +0 -3
- package/lib/typescript/src/Shared/VisionCameraPlugins/FaceDetector/detectFaces.d.ts.map +0 -1
- package/lib/typescript/src/Shared/VisionCameraPlugins/FaceDetector/index.d.ts +0 -3
- package/lib/typescript/src/Shared/VisionCameraPlugins/FaceDetector/index.d.ts.map +0 -1
- package/lib/typescript/src/Shared/VisionCameraPlugins/FaceDetector/types.d.ts +0 -79
- package/lib/typescript/src/Shared/VisionCameraPlugins/FaceDetector/types.d.ts.map +0 -1
- package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/Camera.d.ts +0 -6
- package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/Camera.d.ts.map +0 -1
- package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/PhotoRecognizer.d.ts +0 -3
- package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/PhotoRecognizer.d.ts.map +0 -1
- package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/RemoveLanguageModel.d.ts +0 -3
- package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/RemoveLanguageModel.d.ts.map +0 -1
- package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/index.d.ts +0 -5
- package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/index.d.ts.map +0 -1
- package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/scanText.d.ts +0 -3
- package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/scanText.d.ts.map +0 -1
- package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/translateText.d.ts +0 -3
- package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/translateText.d.ts.map +0 -1
- package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/types.d.ts +0 -67
- package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/types.d.ts.map +0 -1
- package/src/Shared/Libs/camera.utils.ts +0 -345
- package/src/Shared/Libs/frame-enhancement.utils.ts +0 -217
- package/src/Shared/Libs/opencv.utils.ts +0 -40
- package/src/Shared/Libs/worklet.utils.ts +0 -72
- package/src/Shared/VisionCameraPlugins/BarcodeScanner/hooks/useBarcodeScanner.ts +0 -79
- package/src/Shared/VisionCameraPlugins/BarcodeScanner/hooks/useCameraPermissions.ts +0 -46
- package/src/Shared/VisionCameraPlugins/BarcodeScanner/index.ts +0 -60
- package/src/Shared/VisionCameraPlugins/BarcodeScanner/scanCodes.ts +0 -32
- package/src/Shared/VisionCameraPlugins/BarcodeScanner/types.ts +0 -82
- package/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/convert.ts +0 -195
- package/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/geometry.ts +0 -135
- package/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/highlights.ts +0 -84
- package/src/Shared/VisionCameraPlugins/Cropper/index.ts +0 -78
- package/src/Shared/VisionCameraPlugins/FaceDetector/Camera.tsx +0 -63
- package/src/Shared/VisionCameraPlugins/FaceDetector/detectFaces.ts +0 -44
- package/src/Shared/VisionCameraPlugins/FaceDetector/index.ts +0 -3
- package/src/Shared/VisionCameraPlugins/FaceDetector/types.ts +0 -99
- package/src/Shared/VisionCameraPlugins/TextRecognition/Camera.tsx +0 -76
- package/src/Shared/VisionCameraPlugins/TextRecognition/PhotoRecognizer.ts +0 -18
- package/src/Shared/VisionCameraPlugins/TextRecognition/RemoveLanguageModel.ts +0 -7
- package/src/Shared/VisionCameraPlugins/TextRecognition/index.ts +0 -7
- package/src/Shared/VisionCameraPlugins/TextRecognition/scanText.ts +0 -27
- package/src/Shared/VisionCameraPlugins/TextRecognition/translateText.ts +0 -21
- package/src/Shared/VisionCameraPlugins/TextRecognition/types.ts +0 -141
package/README.md
CHANGED
|
@@ -24,26 +24,20 @@ npm install @trustchex/react-native-sdk
|
|
|
24
24
|
### Required Dependencies
|
|
25
25
|
|
|
26
26
|
```sh
|
|
27
|
-
npm install @react-native
|
|
28
|
-
@react-navigation/native@^7.1.14 \
|
|
27
|
+
npm install @react-navigation/native@^7.1.14 \
|
|
29
28
|
@react-navigation/native-stack@^7.3.21 \
|
|
30
|
-
@react-navigation/stack@^7.4.2 \
|
|
31
29
|
lottie-react-native@^7.2.4 \
|
|
32
30
|
react-native-compressor@^1.12.0 \
|
|
33
31
|
react-native-device-info@^13.0.0 \
|
|
34
|
-
react-native-fast-opencv@^0.4.7 \
|
|
35
32
|
react-native-fs@^2.20.0 \
|
|
36
|
-
react-native-gesture-handler@^2.27.1 \
|
|
37
33
|
react-native-get-random-values@^1.11.0 \
|
|
38
34
|
react-native-nfc-manager@^3.16.2 \
|
|
39
35
|
react-native-safe-area-context@^5.5.2 \
|
|
40
|
-
react-native-screens@^4.
|
|
36
|
+
react-native-screens@^4.18.0 \
|
|
41
37
|
react-native-svg@^15.12.0 \
|
|
42
38
|
react-native-tts@^4.1.1 \
|
|
43
39
|
react-native-video@^6.16.1 \
|
|
44
|
-
react-native-
|
|
45
|
-
react-native-webview@^13.15.0 \
|
|
46
|
-
react-native-worklets-core@^1.6.2
|
|
40
|
+
react-native-webview@^13.15.0
|
|
47
41
|
```
|
|
48
42
|
|
|
49
43
|
## Setup
|
|
@@ -53,9 +47,6 @@ npm install @react-native-community/image-editor@^4.3.0 \
|
|
|
53
47
|
```js
|
|
54
48
|
module.exports = {
|
|
55
49
|
presets: ['module:@react-native/babel-preset'],
|
|
56
|
-
plugins: [
|
|
57
|
-
'react-native-worklets-core/plugin',
|
|
58
|
-
],
|
|
59
50
|
};
|
|
60
51
|
```
|
|
61
52
|
|
package/TrustchexSDK.podspec
CHANGED
|
@@ -17,11 +17,12 @@ Pod::Spec.new do |s|
|
|
|
17
17
|
s.private_header_files = "ios/**/*.h"
|
|
18
18
|
|
|
19
19
|
# ML Kit dependencies
|
|
20
|
-
s.dependency "
|
|
21
|
-
s.dependency "
|
|
20
|
+
s.dependency "GoogleMLKit/TextRecognition"
|
|
21
|
+
s.dependency "GoogleMLKit/FaceDetection"
|
|
22
|
+
s.dependency "GoogleMLKit/BarcodeScanning"
|
|
22
23
|
|
|
23
|
-
#
|
|
24
|
-
s.dependency "
|
|
24
|
+
# OpenCV dependency
|
|
25
|
+
s.dependency "OpenCV", "~> 4.3.0"
|
|
25
26
|
|
|
26
27
|
install_modules_dependencies(s)
|
|
27
28
|
end
|
package/android/build.gradle
CHANGED
|
@@ -75,13 +75,12 @@ dependencies {
|
|
|
75
75
|
implementation "com.facebook.react:react-android"
|
|
76
76
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
77
77
|
|
|
78
|
-
//
|
|
79
|
-
implementation project(':react-native-vision-camera')
|
|
80
|
-
|
|
81
|
-
// CameraX dependencies (required for ImageProxy)
|
|
78
|
+
// CameraX dependencies
|
|
82
79
|
implementation "androidx.camera:camera-core:1.4.0"
|
|
83
80
|
implementation "androidx.camera:camera-camera2:1.4.0"
|
|
84
81
|
implementation "androidx.camera:camera-lifecycle:1.4.0"
|
|
82
|
+
implementation "androidx.camera:camera-view:1.4.0"
|
|
83
|
+
implementation "androidx.camera:camera-video:1.4.0"
|
|
85
84
|
|
|
86
85
|
// Google ML Kit dependencies
|
|
87
86
|
implementation 'com.google.mlkit:text-recognition:16.0.1'
|
|
@@ -90,6 +89,9 @@ dependencies {
|
|
|
90
89
|
|
|
91
90
|
// Google Play Services dependency for Tasks
|
|
92
91
|
implementation 'com.google.android.gms:play-services-tasks:18.2.0'
|
|
92
|
+
|
|
93
|
+
// OpenCV for hologram detection and image processing
|
|
94
|
+
implementation 'org.opencv:opencv:4.12.0'
|
|
93
95
|
}
|
|
94
96
|
|
|
95
97
|
react {
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
<uses-permission android:name="android.permission.NFC" />
|
|
6
6
|
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
|
7
7
|
<uses-permission android:name="android.permission.VIBRATE" />
|
|
8
|
-
<uses-feature android:name="android.hardware.camera" android:required="
|
|
8
|
+
<uses-feature android:name="android.hardware.camera" android:required="true" />
|
|
9
9
|
<uses-feature android:name="android.hardware.nfc" android:required="false" />
|
|
10
10
|
</manifest>
|
|
@@ -5,42 +5,29 @@ import com.facebook.react.bridge.NativeModule
|
|
|
5
5
|
import com.facebook.react.bridge.ReactApplicationContext
|
|
6
6
|
import com.facebook.react.module.model.ReactModuleInfo
|
|
7
7
|
import com.facebook.react.module.model.ReactModuleInfoProvider
|
|
8
|
-
import com.
|
|
9
|
-
import com.trustchex.reactnativesdk.
|
|
10
|
-
import com.trustchex.reactnativesdk.
|
|
11
|
-
import com.trustchex.reactnativesdk.
|
|
12
|
-
import com.trustchex.reactnativesdk.
|
|
8
|
+
import com.facebook.react.uimanager.ViewManager
|
|
9
|
+
import com.trustchex.reactnativesdk.camera.TrustchexCameraManager
|
|
10
|
+
import com.trustchex.reactnativesdk.mlkit.MLKitModule
|
|
11
|
+
import com.trustchex.reactnativesdk.mrz.MRZValidationModule
|
|
12
|
+
import com.trustchex.reactnativesdk.opencv.OpenCVModule
|
|
13
13
|
import java.util.HashMap
|
|
14
14
|
|
|
15
15
|
class TrustchexSDKPackage : BaseReactPackage() {
|
|
16
|
-
companion object {
|
|
17
|
-
init {
|
|
18
|
-
// Register frame processor plugins for text recognition
|
|
19
|
-
FrameProcessorPluginRegistry.addFrameProcessorPlugin("scanText") { proxy, options ->
|
|
20
|
-
TextRecognitionFrameProcessorPlugin(proxy, options)
|
|
21
|
-
}
|
|
22
|
-
// Register frame processor plugin for face detection
|
|
23
|
-
FrameProcessorPluginRegistry.addFrameProcessorPlugin("detectFaces") { _, options ->
|
|
24
|
-
FaceDetectorFrameProcessorPlugin(options)
|
|
25
|
-
}
|
|
26
|
-
// Register frame processor plugin for barcode scanning
|
|
27
|
-
FrameProcessorPluginRegistry.addFrameProcessorPlugin("scanCodes") { proxy, options ->
|
|
28
|
-
BarcodeScannerFrameProcessorPlugin(proxy, options)
|
|
29
|
-
}
|
|
30
|
-
// Register frame processor plugin for image cropping
|
|
31
|
-
FrameProcessorPluginRegistry.addFrameProcessorPlugin("crop") { proxy, options ->
|
|
32
|
-
CropperPlugin(proxy, options)
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
16
|
override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? {
|
|
37
17
|
return when (name) {
|
|
38
18
|
TrustchexSDKModule.NAME -> TrustchexSDKModule(reactContext)
|
|
39
19
|
"DeviceBrightness" -> DeviceBrightnessModule(reactContext)
|
|
20
|
+
"MLKitModule" -> MLKitModule(reactContext)
|
|
21
|
+
"OpenCVModule" -> OpenCVModule(reactContext)
|
|
22
|
+
"MRZValidation" -> MRZValidationModule(reactContext)
|
|
40
23
|
else -> null
|
|
41
24
|
}
|
|
42
25
|
}
|
|
43
26
|
|
|
27
|
+
override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> {
|
|
28
|
+
return listOf(TrustchexCameraManager())
|
|
29
|
+
}
|
|
30
|
+
|
|
44
31
|
override fun getReactModuleInfoProvider(): ReactModuleInfoProvider {
|
|
45
32
|
return ReactModuleInfoProvider {
|
|
46
33
|
val moduleInfos: MutableMap<String, ReactModuleInfo> = HashMap()
|
|
@@ -67,6 +54,39 @@ class TrustchexSDKPackage : BaseReactPackage() {
|
|
|
67
54
|
false // isTurboModule
|
|
68
55
|
)
|
|
69
56
|
|
|
57
|
+
// ML Kit module
|
|
58
|
+
moduleInfos["MLKitModule"] =
|
|
59
|
+
ReactModuleInfo(
|
|
60
|
+
"MLKitModule",
|
|
61
|
+
"MLKitModule",
|
|
62
|
+
false, // canOverrideExistingModule
|
|
63
|
+
false, // needsEagerInit
|
|
64
|
+
false, // isCxxModule
|
|
65
|
+
false // isTurboModule
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
// OpenCV module
|
|
69
|
+
moduleInfos["OpenCVModule"] =
|
|
70
|
+
ReactModuleInfo(
|
|
71
|
+
"OpenCVModule",
|
|
72
|
+
"OpenCVModule",
|
|
73
|
+
false, // canOverrideExistingModule
|
|
74
|
+
false, // needsEagerInit
|
|
75
|
+
false, // isCxxModule
|
|
76
|
+
false // isTurboModule
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
// MRZ Validation module
|
|
80
|
+
moduleInfos["MRZValidation"] =
|
|
81
|
+
ReactModuleInfo(
|
|
82
|
+
"MRZValidation",
|
|
83
|
+
"MRZValidation",
|
|
84
|
+
false, // canOverrideExistingModule
|
|
85
|
+
false, // needsEagerInit
|
|
86
|
+
false, // isCxxModule
|
|
87
|
+
false // isTurboModule
|
|
88
|
+
)
|
|
89
|
+
|
|
70
90
|
moduleInfos
|
|
71
91
|
}
|
|
72
92
|
}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
package com.trustchex.reactnativesdk.camera
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.uimanager.SimpleViewManager
|
|
4
|
+
import com.facebook.react.uimanager.ThemedReactContext
|
|
5
|
+
import com.facebook.react.uimanager.annotations.ReactProp
|
|
6
|
+
|
|
7
|
+
class TrustchexCameraManager : SimpleViewManager<TrustchexCameraView>() {
|
|
8
|
+
|
|
9
|
+
companion object {
|
|
10
|
+
const val REACT_CLASS = "TrustchexCamera"
|
|
11
|
+
const val EVENT_FRAME_AVAILABLE = "onFrameAvailable"
|
|
12
|
+
const val EVENT_CAMERA_READY = "onCameraReady"
|
|
13
|
+
const val EVENT_CAMERA_ERROR = "onCameraError"
|
|
14
|
+
const val EVENT_RECORDING_FINISHED = "onRecordingFinished"
|
|
15
|
+
const val EVENT_RECORDING_ERROR = "onRecordingError"
|
|
16
|
+
|
|
17
|
+
const val COMMAND_SET_FOCUS_POINT = 1
|
|
18
|
+
const val COMMAND_SET_EXPOSURE_OFFSET = 2
|
|
19
|
+
const val COMMAND_START_RECORDING = 3
|
|
20
|
+
const val COMMAND_STOP_RECORDING = 4
|
|
21
|
+
const val COMMAND_CANCEL_RECORDING = 5
|
|
22
|
+
const val COMMAND_DELETE_RECORDING = 6
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
override fun getName() = REACT_CLASS
|
|
26
|
+
|
|
27
|
+
override fun createViewInstance(reactContext: ThemedReactContext): TrustchexCameraView {
|
|
28
|
+
return TrustchexCameraView(reactContext)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@ReactProp(name = "cameraType")
|
|
32
|
+
fun setCameraType(view: TrustchexCameraView, cameraType: String) {
|
|
33
|
+
view.setCameraType(cameraType)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@ReactProp(name = "torchEnabled")
|
|
37
|
+
fun setTorchEnabled(view: TrustchexCameraView, enabled: Boolean) {
|
|
38
|
+
view.setTorchEnabled(enabled)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@ReactProp(name = "enableFrameProcessing")
|
|
42
|
+
fun setEnableFrameProcessing(view: TrustchexCameraView, enabled: Boolean) {
|
|
43
|
+
view.setFrameProcessingEnabled(enabled)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@ReactProp(name = "targetFps")
|
|
47
|
+
fun setTargetFps(view: TrustchexCameraView, fps: Int) {
|
|
48
|
+
view.setTargetFps(fps)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@ReactProp(name = "enableFaceDetection")
|
|
52
|
+
fun setEnableFaceDetection(view: TrustchexCameraView, enabled: Boolean) {
|
|
53
|
+
view.setFaceDetectionEnabled(enabled)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
@ReactProp(name = "enableTextRecognition")
|
|
57
|
+
fun setEnableTextRecognition(view: TrustchexCameraView, enabled: Boolean) {
|
|
58
|
+
view.setTextRecognitionEnabled(enabled)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
@ReactProp(name = "enableBarcodeScanning")
|
|
62
|
+
fun setEnableBarcodeScanning(view: TrustchexCameraView, enabled: Boolean) {
|
|
63
|
+
view.setBarcodeScanningEnabled(enabled)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
@ReactProp(name = "enableMrzValidation")
|
|
67
|
+
fun setEnableMrzValidation(view: TrustchexCameraView, enabled: Boolean) {
|
|
68
|
+
view.setMrzValidationEnabled(enabled)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@ReactProp(name = "includeBase64")
|
|
72
|
+
fun setIncludeBase64(view: TrustchexCameraView, enabled: Boolean) {
|
|
73
|
+
view.setIncludeBase64(enabled)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
override fun getExportedCustomDirectEventTypeConstants(): Map<String, Any> {
|
|
77
|
+
return mapOf(
|
|
78
|
+
EVENT_FRAME_AVAILABLE to mapOf("registrationName" to "onFrameAvailable"),
|
|
79
|
+
EVENT_CAMERA_READY to mapOf("registrationName" to "onCameraReady"),
|
|
80
|
+
EVENT_CAMERA_ERROR to mapOf("registrationName" to "onCameraError"),
|
|
81
|
+
EVENT_RECORDING_FINISHED to mapOf("registrationName" to "onRecordingFinished"),
|
|
82
|
+
EVENT_RECORDING_ERROR to mapOf("registrationName" to "onRecordingError")
|
|
83
|
+
)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
override fun getCommandsMap(): Map<String, Int> {
|
|
87
|
+
return mapOf(
|
|
88
|
+
"setFocusPoint" to COMMAND_SET_FOCUS_POINT,
|
|
89
|
+
"setExposureOffset" to COMMAND_SET_EXPOSURE_OFFSET,
|
|
90
|
+
"startRecording" to COMMAND_START_RECORDING,
|
|
91
|
+
"stopRecording" to COMMAND_STOP_RECORDING,
|
|
92
|
+
"cancelRecording" to COMMAND_CANCEL_RECORDING,
|
|
93
|
+
"deleteRecording" to COMMAND_DELETE_RECORDING
|
|
94
|
+
)
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
override fun receiveCommand(view: TrustchexCameraView, commandId: Int, args: com.facebook.react.bridge.ReadableArray?) {
|
|
98
|
+
android.util.Log.d("TrustchexCamera", "receiveCommand(Int) called with commandId: $commandId")
|
|
99
|
+
when (commandId) {
|
|
100
|
+
COMMAND_SET_FOCUS_POINT -> {
|
|
101
|
+
if (args != null && args.size() >= 2) {
|
|
102
|
+
view.setFocusPoint(args.getDouble(0), args.getDouble(1))
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
COMMAND_SET_EXPOSURE_OFFSET -> {
|
|
106
|
+
if (args != null && args.size() >= 1) {
|
|
107
|
+
view.setExposureOffset(args.getDouble(0))
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
COMMAND_START_RECORDING -> {
|
|
111
|
+
android.util.Log.d("TrustchexCamera", "COMMAND_START_RECORDING received")
|
|
112
|
+
view.startRecording()
|
|
113
|
+
}
|
|
114
|
+
COMMAND_STOP_RECORDING -> {
|
|
115
|
+
view.stopRecording()
|
|
116
|
+
}
|
|
117
|
+
COMMAND_CANCEL_RECORDING -> {
|
|
118
|
+
view.cancelRecording()
|
|
119
|
+
}
|
|
120
|
+
COMMAND_DELETE_RECORDING -> {
|
|
121
|
+
if (args != null && args.size() >= 1) {
|
|
122
|
+
val filePath = args.getString(0)
|
|
123
|
+
if (filePath != null) {
|
|
124
|
+
view.deleteRecording(filePath)
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
override fun receiveCommand(view: TrustchexCameraView, commandName: String, args: com.facebook.react.bridge.ReadableArray?) {
|
|
132
|
+
android.util.Log.d("TrustchexCamera", "receiveCommand(String) called with commandName: $commandName")
|
|
133
|
+
when (commandName) {
|
|
134
|
+
"setFocusPoint" -> {
|
|
135
|
+
if (args != null && args.size() >= 2) {
|
|
136
|
+
view.setFocusPoint(args.getDouble(0), args.getDouble(1))
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
"setExposureOffset" -> {
|
|
140
|
+
if (args != null && args.size() >= 1) {
|
|
141
|
+
view.setExposureOffset(args.getDouble(0))
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
"startRecording" -> {
|
|
145
|
+
view.startRecording()
|
|
146
|
+
}
|
|
147
|
+
"stopRecording" -> {
|
|
148
|
+
view.stopRecording()
|
|
149
|
+
}
|
|
150
|
+
"cancelRecording" -> {
|
|
151
|
+
view.cancelRecording()
|
|
152
|
+
}
|
|
153
|
+
"deleteRecording" -> {
|
|
154
|
+
if (args != null && args.size() >= 1) {
|
|
155
|
+
val filePath = args.getString(0)
|
|
156
|
+
if (filePath != null) {
|
|
157
|
+
view.deleteRecording(filePath)
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
override fun onDropViewInstance(view: TrustchexCameraView) {
|
|
165
|
+
super.onDropViewInstance(view)
|
|
166
|
+
view.cleanup()
|
|
167
|
+
}
|
|
168
|
+
}
|