@trustchex/react-native-sdk 1.354.1 → 1.357.0
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 +2 -9
- 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 -13
- 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 +2149 -778
- 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/http-client.js +1 -0
- package/lib/module/Shared/Libs/mrz.utils.js +1 -176
- 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 +10 -19
- 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 +13 -36
- 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 -104
- 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 +3070 -1036
- 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/debounce.utils.ts +1 -1
- 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 +13 -8
- package/src/Shared/Libs/mrz.utils.ts +1 -164
- 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 +22 -17
- 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 -53
- 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 -3
- 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 -58
- 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
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
useCallback,
|
|
3
|
-
useContext,
|
|
4
|
-
useEffect,
|
|
5
|
-
useRef,
|
|
6
|
-
useState,
|
|
7
|
-
} from 'react';
|
|
1
|
+
import React, { useCallback, useContext, useRef, useState } from 'react';
|
|
8
2
|
import {
|
|
9
3
|
SafeAreaView,
|
|
10
4
|
Text,
|
|
@@ -18,9 +12,17 @@ import {
|
|
|
18
12
|
ScrollView,
|
|
19
13
|
} from 'react-native';
|
|
20
14
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
21
|
-
import {
|
|
15
|
+
import {
|
|
16
|
+
useRoute,
|
|
17
|
+
type RouteProp,
|
|
18
|
+
useFocusEffect,
|
|
19
|
+
} from '@react-navigation/native';
|
|
22
20
|
import AppContext from '../../Shared/Contexts/AppContext';
|
|
23
|
-
import httpClient, {
|
|
21
|
+
import httpClient, {
|
|
22
|
+
BadRequestError,
|
|
23
|
+
NotFoundError,
|
|
24
|
+
TooManyRequestsError,
|
|
25
|
+
} from '../../Shared/Libs/http-client';
|
|
24
26
|
import { useTranslation } from 'react-i18next';
|
|
25
27
|
import LanguageSelector from '../../Shared/Components/LanguageSelector';
|
|
26
28
|
import NavigationManager, {
|
|
@@ -31,9 +33,7 @@ import StyledButton from '../../Shared/Components/StyledButton';
|
|
|
31
33
|
import StyledTextInput from '../../Shared/Components/StyledTextInput';
|
|
32
34
|
import { useTheme } from '../../Shared/Contexts/ThemeContext';
|
|
33
35
|
import LottieView from 'lottie-react-native';
|
|
34
|
-
import {
|
|
35
|
-
getSimulatedDemoData,
|
|
36
|
-
} from '../../Shared/Libs/demo.utils';
|
|
36
|
+
import { getSimulatedDemoData } from '../../Shared/Libs/demo.utils';
|
|
37
37
|
import {
|
|
38
38
|
trackError,
|
|
39
39
|
useScreenTracking,
|
|
@@ -44,7 +44,8 @@ type OTPVerificationScreenParams = {
|
|
|
44
44
|
};
|
|
45
45
|
|
|
46
46
|
const OTPVerificationScreen = () => {
|
|
47
|
-
const route =
|
|
47
|
+
const route =
|
|
48
|
+
useRoute<RouteProp<{ params: OTPVerificationScreenParams }, 'params'>>();
|
|
48
49
|
const sessionId = route.params?.sessionId;
|
|
49
50
|
const [code, setCode] = useState('');
|
|
50
51
|
const [isSendAgainEnabled, setIsSendAgainEnabled] = useState(false);
|
|
@@ -62,7 +63,9 @@ const OTPVerificationScreen = () => {
|
|
|
62
63
|
// Guard: If sessionId is not provided, show error
|
|
63
64
|
if (!sessionId) {
|
|
64
65
|
return (
|
|
65
|
-
<SafeAreaView
|
|
66
|
+
<SafeAreaView
|
|
67
|
+
style={[styles.container, { backgroundColor: theme.colors.background }]}
|
|
68
|
+
>
|
|
66
69
|
<Text style={[styles.errorText, { color: theme.colors.error }]}>
|
|
67
70
|
{t('general.sessionNotFound')}
|
|
68
71
|
</Text>
|
|
@@ -73,10 +76,10 @@ const OTPVerificationScreen = () => {
|
|
|
73
76
|
const apiUrl = `${appContext.baseUrl}/api/app/mobile`;
|
|
74
77
|
|
|
75
78
|
const sendVerificationCode = useCallback(
|
|
76
|
-
async (
|
|
79
|
+
async (id: string) => {
|
|
77
80
|
try {
|
|
78
81
|
await httpClient.post(
|
|
79
|
-
`${apiUrl}/verification-sessions/${
|
|
82
|
+
`${apiUrl}/verification-sessions/${id}`,
|
|
80
83
|
{},
|
|
81
84
|
appContext.isDemoSession
|
|
82
85
|
? getSimulatedDemoData('SEND_VERIFICATION_CODE')
|
|
@@ -111,21 +114,21 @@ const OTPVerificationScreen = () => {
|
|
|
111
114
|
);
|
|
112
115
|
|
|
113
116
|
const getVerifiedSession = useCallback(
|
|
114
|
-
async (
|
|
117
|
+
async (id: string, verificationCode: string) => {
|
|
115
118
|
try {
|
|
116
119
|
const response = await httpClient.post<
|
|
117
120
|
VerificationSession,
|
|
118
121
|
{ code: string }
|
|
119
122
|
>(
|
|
120
|
-
`${apiUrl}/verification-sessions/${
|
|
123
|
+
`${apiUrl}/verification-sessions/${id}`,
|
|
121
124
|
{
|
|
122
125
|
code: verificationCode,
|
|
123
126
|
},
|
|
124
127
|
appContext.isDemoSession
|
|
125
128
|
? getSimulatedDemoData<
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
+
VerificationSession | undefined,
|
|
130
|
+
{ code: string }
|
|
131
|
+
>('GET_VERIFIED_SESSION', { code: verificationCode })
|
|
129
132
|
: undefined
|
|
130
133
|
);
|
|
131
134
|
|
|
@@ -153,12 +156,12 @@ const OTPVerificationScreen = () => {
|
|
|
153
156
|
);
|
|
154
157
|
|
|
155
158
|
const sendOTPCode = useCallback(
|
|
156
|
-
async (
|
|
157
|
-
if (!
|
|
159
|
+
async (id: string) => {
|
|
160
|
+
if (!id) {
|
|
158
161
|
return false;
|
|
159
162
|
}
|
|
160
163
|
|
|
161
|
-
const isSent = await sendVerificationCode(
|
|
164
|
+
const isSent = await sendVerificationCode(id);
|
|
162
165
|
|
|
163
166
|
if (!isSent) {
|
|
164
167
|
return false;
|
|
@@ -178,12 +181,14 @@ const OTPVerificationScreen = () => {
|
|
|
178
181
|
[sendVerificationCode]
|
|
179
182
|
);
|
|
180
183
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
initialized.current
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
184
|
+
useFocusEffect(
|
|
185
|
+
useCallback(() => {
|
|
186
|
+
if (!initialized.current && sessionId) {
|
|
187
|
+
initialized.current = true;
|
|
188
|
+
sendOTPCode(sessionId);
|
|
189
|
+
}
|
|
190
|
+
}, [sessionId, sendOTPCode])
|
|
191
|
+
);
|
|
187
192
|
|
|
188
193
|
return (
|
|
189
194
|
<SafeAreaView style={styles.safeAreaContainer}>
|
|
@@ -252,7 +257,8 @@ const OTPVerificationScreen = () => {
|
|
|
252
257
|
verifiedSession?.identificationId;
|
|
253
258
|
// Update workflow steps from verified session if available
|
|
254
259
|
if (verifiedSession.workflowSteps) {
|
|
255
|
-
appContext.workflowSteps =
|
|
260
|
+
appContext.workflowSteps =
|
|
261
|
+
verifiedSession.workflowSteps;
|
|
256
262
|
}
|
|
257
263
|
setCode('');
|
|
258
264
|
navigationManagerRef.current?.navigateToNextStep();
|
|
@@ -30,9 +30,16 @@ const QrCodeScanningScreen = () => {
|
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
+
const onClose = () => {
|
|
34
|
+
navigation.goBack();
|
|
35
|
+
};
|
|
36
|
+
|
|
33
37
|
return (
|
|
34
38
|
<SafeAreaView style={styles.container}>
|
|
35
|
-
<QrCodeScannerCamera
|
|
39
|
+
<QrCodeScannerCamera
|
|
40
|
+
onQrCodeScanned={onQrCodeScanned}
|
|
41
|
+
onClose={onClose}
|
|
42
|
+
/>
|
|
36
43
|
</SafeAreaView>
|
|
37
44
|
);
|
|
38
45
|
};
|
|
@@ -158,7 +158,6 @@ const ResultScreen = () => {
|
|
|
158
158
|
async (identificationId: string, sessionKey: string) => {
|
|
159
159
|
// Ensure device info is always populated before sending consent
|
|
160
160
|
if (!appContext.identificationInfo.consent.deviceInfo) {
|
|
161
|
-
console.log('Device info not set, generating now...');
|
|
162
161
|
appContext.identificationInfo.consent.deviceInfo =
|
|
163
162
|
await NativeDeviceInfo.generateHumanReadableIdentifier();
|
|
164
163
|
}
|
|
@@ -199,9 +198,6 @@ const ResultScreen = () => {
|
|
|
199
198
|
personalNumber:
|
|
200
199
|
scannedDocument.mrzFields.personalNumber ||
|
|
201
200
|
scannedDocument.mrzFields.optional1,
|
|
202
|
-
issueDate: mrzUtils.convertMRZDateToISODate(
|
|
203
|
-
scannedDocument.mrzFields.issueDate
|
|
204
|
-
),
|
|
205
201
|
birthDate: mrzUtils.convertMRZDateToISODate(
|
|
206
202
|
scannedDocument.mrzFields.birthDate
|
|
207
203
|
),
|
|
@@ -391,10 +387,6 @@ const ResultScreen = () => {
|
|
|
391
387
|
}
|
|
392
388
|
await RNFS.copyFile(livenessVideoPath, videoFilePath);
|
|
393
389
|
|
|
394
|
-
// Get original file size
|
|
395
|
-
const originalStats = await RNFS.stat(videoFilePath);
|
|
396
|
-
const originalSize = originalStats.size;
|
|
397
|
-
|
|
398
390
|
// Compress video with maximum compression settings
|
|
399
391
|
const compressedVideoPath = await VideoCompressor.compress(
|
|
400
392
|
videoFilePath,
|
|
@@ -413,17 +405,6 @@ const ResultScreen = () => {
|
|
|
413
405
|
// Convert file:// URI to regular path for RNFS upload
|
|
414
406
|
const normalizedPath = compressedVideoPath.replace('file://', '');
|
|
415
407
|
|
|
416
|
-
// Get compressed file size and log difference
|
|
417
|
-
const compressedStats = await RNFS.stat(normalizedPath);
|
|
418
|
-
const compressedSize = compressedStats.size;
|
|
419
|
-
const compressionRatio = (
|
|
420
|
-
((originalSize - compressedSize) / originalSize) *
|
|
421
|
-
100
|
|
422
|
-
).toFixed(2);
|
|
423
|
-
console.log(
|
|
424
|
-
`Video compression: ${(originalSize / 1024 / 1024).toFixed(2)}MB -> ${(compressedSize / 1024 / 1024).toFixed(2)}MB (${compressionRatio}% reduction)`
|
|
425
|
-
);
|
|
426
|
-
|
|
427
408
|
uploadFileOptions.files.push({
|
|
428
409
|
name: 'files',
|
|
429
410
|
filename: 'LIVENESS_VIDEO.mp4',
|
|
@@ -495,12 +476,20 @@ const ResultScreen = () => {
|
|
|
495
476
|
setIsSubmitting(false);
|
|
496
477
|
|
|
497
478
|
// Track successful verification completion as final funnel step
|
|
498
|
-
trackFunnelStep(
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
479
|
+
trackFunnelStep(
|
|
480
|
+
'Verification Completed',
|
|
481
|
+
5,
|
|
482
|
+
5,
|
|
483
|
+
'nfc_scanning',
|
|
484
|
+
true
|
|
485
|
+
).catch(() => {});
|
|
486
|
+
analyticsService
|
|
487
|
+
.trackEvent(
|
|
488
|
+
AnalyticsEventName.VERIFICATION_SUCCESS,
|
|
489
|
+
AnalyticsEventCategory.VERIFICATION,
|
|
490
|
+
{ sessionId: appContext.identificationInfo.sessionId || '' }
|
|
491
|
+
)
|
|
492
|
+
.catch(() => {});
|
|
504
493
|
} catch (error) {
|
|
505
494
|
setIsSubmitting(false);
|
|
506
495
|
setProgress(0);
|
|
@@ -514,15 +503,17 @@ const ResultScreen = () => {
|
|
|
514
503
|
'result_screen',
|
|
515
504
|
'critical',
|
|
516
505
|
{ recoverable: false, userAction: 'submit_verification' }
|
|
517
|
-
).catch(() => {
|
|
518
|
-
analyticsService
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
506
|
+
).catch(() => {});
|
|
507
|
+
analyticsService
|
|
508
|
+
.trackEvent(
|
|
509
|
+
AnalyticsEventName.VERIFICATION_FAILED,
|
|
510
|
+
AnalyticsEventCategory.VERIFICATION,
|
|
511
|
+
{
|
|
512
|
+
sessionId: appContext.identificationInfo.sessionId || '',
|
|
513
|
+
errorMessage,
|
|
514
|
+
}
|
|
515
|
+
)
|
|
516
|
+
.catch(() => {});
|
|
526
517
|
|
|
527
518
|
Alert.alert(t('general.error'), t('resultScreen.submissionFailed'));
|
|
528
519
|
appContext.onError?.(t('resultScreen.submissionFailed'));
|
|
@@ -712,7 +703,23 @@ const ResultScreen = () => {
|
|
|
712
703
|
{t('eidScannerScreen.mrzText')}
|
|
713
704
|
</Text>
|
|
714
705
|
<Text style={styles.mrzTextValue}>
|
|
715
|
-
{
|
|
706
|
+
{
|
|
707
|
+
appContext.identificationInfo.scannedDocument
|
|
708
|
+
.mrzText
|
|
709
|
+
}
|
|
710
|
+
</Text>
|
|
711
|
+
</View>
|
|
712
|
+
)}
|
|
713
|
+
|
|
714
|
+
{appContext.identificationInfo.scannedDocument
|
|
715
|
+
.barcodeValue && (
|
|
716
|
+
<View style={styles.mrzTextContainer}>
|
|
717
|
+
<Text style={styles.mrzTextLabel}>Barcode Value</Text>
|
|
718
|
+
<Text style={styles.mrzTextValue}>
|
|
719
|
+
{
|
|
720
|
+
appContext.identificationInfo.scannedDocument
|
|
721
|
+
.barcodeValue
|
|
722
|
+
}
|
|
716
723
|
</Text>
|
|
717
724
|
</View>
|
|
718
725
|
)}
|
|
@@ -724,84 +731,89 @@ const ResultScreen = () => {
|
|
|
724
731
|
<View style={styles.imageContainer}>
|
|
725
732
|
{appContext.identificationInfo.scannedDocument
|
|
726
733
|
.frontImage && (
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
734
|
+
<View style={styles.imageItem}>
|
|
735
|
+
<Image
|
|
736
|
+
style={styles.image}
|
|
737
|
+
source={{
|
|
738
|
+
uri: `data:image/jpeg;base64,${
|
|
739
|
+
appContext.identificationInfo.scannedDocument
|
|
732
740
|
.frontImage
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
+
}`,
|
|
742
|
+
}}
|
|
743
|
+
/>
|
|
744
|
+
<Text style={styles.imageText}>
|
|
745
|
+
{t('resultScreen.demoImageFront')}
|
|
746
|
+
</Text>
|
|
747
|
+
</View>
|
|
748
|
+
)}
|
|
741
749
|
{appContext.identificationInfo.scannedDocument
|
|
742
750
|
.backImage && (
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
751
|
+
<View style={styles.imageItem}>
|
|
752
|
+
<Image
|
|
753
|
+
style={styles.image}
|
|
754
|
+
source={{
|
|
755
|
+
uri: `data:image/jpeg;base64,${
|
|
756
|
+
appContext.identificationInfo.scannedDocument
|
|
748
757
|
.backImage
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
758
|
+
}`,
|
|
759
|
+
}}
|
|
760
|
+
/>
|
|
761
|
+
<Text style={styles.imageText}>
|
|
762
|
+
{t('resultScreen.demoImageBack')}
|
|
763
|
+
</Text>
|
|
764
|
+
</View>
|
|
765
|
+
)}
|
|
757
766
|
{appContext.identificationInfo.scannedDocument
|
|
758
767
|
.faceImage && (
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
768
|
+
<View style={styles.imageItem}>
|
|
769
|
+
<Image
|
|
770
|
+
style={styles.image}
|
|
771
|
+
source={{
|
|
772
|
+
uri: `data:image/jpeg;base64,${
|
|
773
|
+
appContext.identificationInfo.scannedDocument
|
|
764
774
|
.faceImage
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
775
|
+
}`,
|
|
776
|
+
}}
|
|
777
|
+
/>
|
|
778
|
+
<Text style={styles.imageText}>
|
|
779
|
+
{t('resultScreen.demoImageFace')}
|
|
780
|
+
</Text>
|
|
781
|
+
</View>
|
|
782
|
+
)}
|
|
773
783
|
{appContext.identificationInfo.scannedDocument
|
|
774
784
|
.secondaryFaceImage && (
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
785
|
+
<View style={styles.imageItem}>
|
|
786
|
+
<Image
|
|
787
|
+
style={styles.image}
|
|
788
|
+
source={{
|
|
789
|
+
uri: `data:image/jpeg;base64,${
|
|
790
|
+
appContext.identificationInfo.scannedDocument
|
|
780
791
|
.secondaryFaceImage
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
792
|
+
}`,
|
|
793
|
+
}}
|
|
794
|
+
/>
|
|
795
|
+
<Text style={styles.imageText}>
|
|
796
|
+
{t('resultScreen.demoImageSecondaryFace')}
|
|
797
|
+
</Text>
|
|
798
|
+
</View>
|
|
799
|
+
)}
|
|
789
800
|
{appContext.identificationInfo.scannedDocument
|
|
790
801
|
.hologramImage && (
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
802
|
+
<View style={styles.imageItem}>
|
|
803
|
+
<Image
|
|
804
|
+
style={styles.image}
|
|
805
|
+
source={{
|
|
806
|
+
uri: `data:image/jpeg;base64,${
|
|
807
|
+
appContext.identificationInfo.scannedDocument
|
|
796
808
|
.hologramImage
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
809
|
+
}`,
|
|
810
|
+
}}
|
|
811
|
+
/>
|
|
812
|
+
<Text style={styles.imageText}>
|
|
813
|
+
{t('resultScreen.demoImageHologram')}
|
|
814
|
+
</Text>
|
|
815
|
+
</View>
|
|
816
|
+
)}
|
|
805
817
|
</View>
|
|
806
818
|
</ScrollView>
|
|
807
819
|
</>
|
|
@@ -840,10 +852,30 @@ const ResultScreen = () => {
|
|
|
840
852
|
}}
|
|
841
853
|
/>
|
|
842
854
|
<Text style={styles.imageText}>
|
|
843
|
-
{
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
855
|
+
{(() => {
|
|
856
|
+
switch (instruction.instruction) {
|
|
857
|
+
case 'SMILE':
|
|
858
|
+
return t('livenessDetectionScreen.smile');
|
|
859
|
+
case 'LOOK_STRAIGHT_AND_BLINK':
|
|
860
|
+
return t(
|
|
861
|
+
'livenessDetectionScreen.lookStraightAndBlink'
|
|
862
|
+
);
|
|
863
|
+
case 'TURN_HEAD_LEFT':
|
|
864
|
+
return t(
|
|
865
|
+
'livenessDetectionScreen.turnHeadLeft'
|
|
866
|
+
);
|
|
867
|
+
case 'TURN_HEAD_RIGHT':
|
|
868
|
+
return t(
|
|
869
|
+
'livenessDetectionScreen.turnHeadRight'
|
|
870
|
+
);
|
|
871
|
+
case 'LOOK_UP':
|
|
872
|
+
return t(
|
|
873
|
+
'livenessDetectionScreen.lookUp'
|
|
874
|
+
);
|
|
875
|
+
default:
|
|
876
|
+
return instruction.instruction;
|
|
877
|
+
}
|
|
878
|
+
})()}
|
|
847
879
|
</Text>
|
|
848
880
|
</View>
|
|
849
881
|
))}
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
getSimulatedDemoData,
|
|
37
37
|
isDemoSession,
|
|
38
38
|
} from '../../Shared/Libs/demo.utils';
|
|
39
|
-
import { useNavigation } from '@react-navigation/native';
|
|
39
|
+
import { useNavigation, useFocusEffect } from '@react-navigation/native';
|
|
40
40
|
import {
|
|
41
41
|
SESSION_CODE_CHARSET_PATTERN,
|
|
42
42
|
SESSION_CODE_VALIDATION_PATTERN,
|
|
@@ -80,8 +80,8 @@ const VerificationSessionCheckScreen = () => {
|
|
|
80
80
|
`${apiUrl}/verification-sessions/${id}`,
|
|
81
81
|
isDemo
|
|
82
82
|
? getSimulatedDemoData<VerificationSession | undefined, void>(
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
'GET_SESSION'
|
|
84
|
+
)
|
|
85
85
|
: undefined
|
|
86
86
|
);
|
|
87
87
|
return response;
|
|
@@ -116,8 +116,8 @@ const VerificationSessionCheckScreen = () => {
|
|
|
116
116
|
`${apiUrl}/verification-sessions?sessionCode=${inputCode.toUpperCase()}`,
|
|
117
117
|
isDemoMode
|
|
118
118
|
? getSimulatedDemoData<{ id: string } | undefined, void>(
|
|
119
|
-
|
|
120
|
-
|
|
119
|
+
'GET_SESSION_BY_CODE'
|
|
120
|
+
)
|
|
121
121
|
: undefined
|
|
122
122
|
);
|
|
123
123
|
|
|
@@ -157,26 +157,54 @@ const VerificationSessionCheckScreen = () => {
|
|
|
157
157
|
[navigation]
|
|
158
158
|
);
|
|
159
159
|
|
|
160
|
+
// Reset initialized flag when screen is focused and sessionId is empty (after reset)
|
|
161
|
+
useFocusEffect(
|
|
162
|
+
useCallback(() => {
|
|
163
|
+
if (!appContext.identificationInfo.sessionId) {
|
|
164
|
+
initialized.current = false;
|
|
165
|
+
isCheckingSessionRef.current = false;
|
|
166
|
+
}
|
|
167
|
+
}, [appContext.identificationInfo.sessionId])
|
|
168
|
+
);
|
|
169
|
+
|
|
160
170
|
useEffect(() => {
|
|
161
171
|
// Only run this effect if sessionId exists AND we're not currently checking a session
|
|
162
172
|
// This prevents race condition when session code is entered
|
|
163
|
-
if (
|
|
173
|
+
if (
|
|
174
|
+
!initialized.current &&
|
|
175
|
+
appContext.identificationInfo.sessionId &&
|
|
176
|
+
!isCheckingSessionRef.current
|
|
177
|
+
) {
|
|
164
178
|
initialized.current = true;
|
|
165
179
|
isCheckingSessionRef.current = true;
|
|
166
180
|
setIsCheckingSession(true);
|
|
167
181
|
getSession(appContext.identificationInfo.sessionId)
|
|
168
182
|
.then((session) => {
|
|
169
|
-
|
|
170
|
-
|
|
183
|
+
if (!session) {
|
|
184
|
+
// Session not found - clear the sessionId and reset flags to allow retry
|
|
185
|
+
Alert.alert(
|
|
186
|
+
t('general.error'),
|
|
187
|
+
t('verificationSessionCheckScreen.noVerificationSessionFound')
|
|
188
|
+
);
|
|
189
|
+
appContext.identificationInfo.sessionId = '';
|
|
190
|
+
if (appContext.setSessionId) {
|
|
191
|
+
appContext.setSessionId('');
|
|
192
|
+
}
|
|
193
|
+
initialized.current = false;
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
appContext.workflowSteps = session.workflowSteps;
|
|
198
|
+
if (session.branding) {
|
|
171
199
|
appContext.branding = appContext.branding || session.branding;
|
|
172
200
|
}
|
|
173
201
|
|
|
174
|
-
if (session
|
|
202
|
+
if (session.sendOTP) {
|
|
175
203
|
navigateToOTPScreen(session.id);
|
|
176
204
|
} else {
|
|
177
|
-
if (session
|
|
205
|
+
if (session.identificationId) {
|
|
178
206
|
appContext.identificationInfo.identificationId =
|
|
179
|
-
session
|
|
207
|
+
session.identificationId;
|
|
180
208
|
}
|
|
181
209
|
navigationManagerRef.current?.navigateToNextStep();
|
|
182
210
|
}
|
|
@@ -193,6 +221,7 @@ const VerificationSessionCheckScreen = () => {
|
|
|
193
221
|
appContext.identificationInfo.sessionId,
|
|
194
222
|
getSession,
|
|
195
223
|
navigateToOTPScreen,
|
|
224
|
+
t,
|
|
196
225
|
]);
|
|
197
226
|
|
|
198
227
|
return (
|
|
@@ -270,10 +299,14 @@ const VerificationSessionCheckScreen = () => {
|
|
|
270
299
|
sessionResponse.id;
|
|
271
300
|
}
|
|
272
301
|
|
|
273
|
-
const session = await getSession(
|
|
302
|
+
const session = await getSession(
|
|
303
|
+
sessionResponse.id,
|
|
304
|
+
isDemoMode
|
|
305
|
+
);
|
|
274
306
|
appContext.workflowSteps = session?.workflowSteps;
|
|
275
307
|
if (session?.branding) {
|
|
276
|
-
appContext.branding =
|
|
308
|
+
appContext.branding =
|
|
309
|
+
appContext.branding || session.branding;
|
|
277
310
|
}
|
|
278
311
|
|
|
279
312
|
if (session?.sendOTP) {
|