@trustchex/react-native-sdk 1.381.0 → 1.409.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/android/src/main/java/com/trustchex/reactnativesdk/camera/TrustchexCameraView.kt +1 -12
- package/android/src/main/java/com/trustchex/reactnativesdk/mlkit/MLKitModule.kt +1 -1
- package/ios/Camera/TrustchexCameraView.swift +1 -12
- package/ios/MLKit/MLKitModule.swift +1 -1
- package/lib/module/Screens/Debug/BarcodeTestScreen.js +308 -0
- package/lib/module/Screens/Debug/MRZTestScreen.js +105 -13
- package/lib/module/Screens/Dynamic/ContractAcceptanceScreen.js +49 -29
- package/lib/module/Screens/Dynamic/IdentityDocumentEIDScanningScreen.js +5 -0
- package/lib/module/Screens/Dynamic/IdentityDocumentScanningScreen.js +5 -0
- package/lib/module/Screens/Dynamic/LivenessDetectionScreen.js +26 -6
- package/lib/module/Screens/Dynamic/VideoCallScreen.js +676 -0
- package/lib/module/Screens/Static/OTPVerificationScreen.js +6 -0
- package/lib/module/Screens/Static/QrCodeScanningScreen.js +7 -1
- package/lib/module/Screens/Static/ResultScreen.js +27 -13
- package/lib/module/Screens/Static/VerificationSessionCheckScreen.js +51 -51
- package/lib/module/Shared/Animations/video-call.json +1 -0
- package/lib/module/Shared/Components/DebugNavigationPanel.js +180 -14
- package/lib/module/Shared/Components/EIDScanner.js +1 -4
- package/lib/module/Shared/Components/IdentityDocumentCamera.js +29 -8
- package/lib/module/Shared/Components/NavigationManager.js +15 -3
- package/lib/module/Shared/Contexts/AppContext.js +1 -0
- package/lib/module/Shared/Libs/SignalingClient.js +128 -0
- package/lib/module/Shared/Libs/analytics.utils.js +4 -0
- package/lib/module/Shared/Libs/deeplink.utils.js +9 -1
- package/lib/module/Shared/Libs/http-client.js +9 -0
- package/lib/module/Shared/Libs/promise.utils.js +16 -2
- package/lib/module/Shared/Libs/status-bar.utils.js +21 -0
- package/lib/module/Shared/Services/DataUploadService.js +294 -0
- package/lib/module/Shared/Services/VideoSessionService.js +156 -0
- package/lib/module/Shared/Services/WebRTCService.js +510 -0
- package/lib/module/Shared/Types/analytics.types.js +2 -0
- package/lib/module/Translation/Resources/en.js +20 -0
- package/lib/module/Translation/Resources/tr.js +20 -0
- package/lib/module/Trustchex.js +10 -0
- package/lib/module/version.js +1 -1
- package/lib/typescript/src/Screens/Debug/BarcodeTestScreen.d.ts +3 -0
- package/lib/typescript/src/Screens/Debug/BarcodeTestScreen.d.ts.map +1 -0
- package/lib/typescript/src/Screens/Debug/MRZTestScreen.d.ts.map +1 -1
- package/lib/typescript/src/Screens/Dynamic/ContractAcceptanceScreen.d.ts.map +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/Dynamic/VideoCallScreen.d.ts +3 -0
- package/lib/typescript/src/Screens/Dynamic/VideoCallScreen.d.ts.map +1 -0
- 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.map +1 -1
- package/lib/typescript/src/Shared/Components/IdentityDocumentCamera.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Components/NavigationManager.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Contexts/AppContext.d.ts +1 -0
- package/lib/typescript/src/Shared/Contexts/AppContext.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Libs/SignalingClient.d.ts +24 -0
- package/lib/typescript/src/Shared/Libs/SignalingClient.d.ts.map +1 -0
- package/lib/typescript/src/Shared/Libs/analytics.utils.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Libs/deeplink.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/promise.utils.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Libs/status-bar.utils.d.ts +9 -0
- package/lib/typescript/src/Shared/Libs/status-bar.utils.d.ts.map +1 -0
- package/lib/typescript/src/Shared/Services/DataUploadService.d.ts +25 -0
- package/lib/typescript/src/Shared/Services/DataUploadService.d.ts.map +1 -0
- package/lib/typescript/src/Shared/Services/VideoSessionService.d.ts +33 -0
- package/lib/typescript/src/Shared/Services/VideoSessionService.d.ts.map +1 -0
- package/lib/typescript/src/Shared/Services/WebRTCService.d.ts +58 -0
- package/lib/typescript/src/Shared/Services/WebRTCService.d.ts.map +1 -0
- package/lib/typescript/src/Shared/Types/analytics.types.d.ts +2 -0
- package/lib/typescript/src/Shared/Types/analytics.types.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Types/identificationInfo.d.ts +4 -1
- package/lib/typescript/src/Shared/Types/identificationInfo.d.ts.map +1 -1
- package/lib/typescript/src/Translation/Resources/en.d.ts +20 -0
- package/lib/typescript/src/Translation/Resources/en.d.ts.map +1 -1
- package/lib/typescript/src/Translation/Resources/tr.d.ts +20 -0
- package/lib/typescript/src/Translation/Resources/tr.d.ts.map +1 -1
- package/lib/typescript/src/Trustchex.d.ts.map +1 -1
- package/lib/typescript/src/version.d.ts +1 -1
- package/package.json +29 -2
- package/src/Screens/Debug/BarcodeTestScreen.tsx +317 -0
- package/src/Screens/Debug/MRZTestScreen.tsx +107 -13
- package/src/Screens/Dynamic/ContractAcceptanceScreen.tsx +59 -33
- package/src/Screens/Dynamic/IdentityDocumentEIDScanningScreen.tsx +6 -0
- package/src/Screens/Dynamic/IdentityDocumentScanningScreen.tsx +6 -0
- package/src/Screens/Dynamic/LivenessDetectionScreen.tsx +34 -6
- package/src/Screens/Dynamic/VideoCallScreen.tsx +764 -0
- package/src/Screens/Static/OTPVerificationScreen.tsx +6 -0
- package/src/Screens/Static/QrCodeScanningScreen.tsx +7 -1
- package/src/Screens/Static/ResultScreen.tsx +58 -23
- package/src/Screens/Static/VerificationSessionCheckScreen.tsx +58 -72
- package/src/Shared/Animations/video-call.json +1 -0
- package/src/Shared/Components/DebugNavigationPanel.tsx +185 -9
- package/src/Shared/Components/EIDScanner.tsx +1 -5
- package/src/Shared/Components/IdentityDocumentCamera.tsx +29 -8
- package/src/Shared/Components/NavigationManager.tsx +14 -1
- package/src/Shared/Contexts/AppContext.ts +2 -0
- package/src/Shared/Libs/SignalingClient.ts +189 -0
- package/src/Shared/Libs/analytics.utils.ts +4 -0
- package/src/Shared/Libs/deeplink.utils.ts +12 -1
- package/src/Shared/Libs/http-client.ts +10 -0
- package/src/Shared/Libs/promise.utils.ts +16 -2
- package/src/Shared/Libs/status-bar.utils.ts +19 -0
- package/src/Shared/Services/DataUploadService.ts +395 -0
- package/src/Shared/Services/VideoSessionService.ts +190 -0
- package/src/Shared/Services/WebRTCService.ts +636 -0
- package/src/Shared/Types/analytics.types.ts +2 -0
- package/src/Shared/Types/identificationInfo.ts +5 -1
- package/src/Translation/Resources/en.ts +25 -0
- package/src/Translation/Resources/tr.ts +27 -0
- package/src/Trustchex.tsx +12 -2
- package/src/version.ts +1 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import Svg, { Rect as SvgRect, Circle, Mask } from 'react-native-svg';
|
|
4
4
|
import { useNavigation } from '@react-navigation/native';
|
|
5
5
|
import React, { useState, useReducer, useContext, useEffect, useCallback, useRef } from 'react';
|
|
6
|
-
import { StyleSheet, Text, View, Dimensions, Vibration } from 'react-native';
|
|
6
|
+
import { StyleSheet, Text, View, Dimensions, Vibration, StatusBar } from 'react-native';
|
|
7
7
|
import { useSafeAreaInsets, SafeAreaView } from 'react-native-safe-area-context';
|
|
8
8
|
import NativeCircularProgress from "../../Shared/Components/NativeCircularProgress.js";
|
|
9
9
|
import FaceCamera from "../../Shared/Components/FaceCamera.js";
|
|
@@ -14,7 +14,9 @@ import { useTranslation } from 'react-i18next';
|
|
|
14
14
|
import StyledButton from "../../Shared/Components/StyledButton.js";
|
|
15
15
|
import LottieView from 'lottie-react-native';
|
|
16
16
|
import { speak, resetLastMessage } from "../../Shared/Libs/tts.utils.js";
|
|
17
|
+
import { useStatusBarWhiteBackground } from "../../Shared/Libs/status-bar.utils.js";
|
|
17
18
|
import { trackFunnelStep, useScreenTracking, trackVerificationStart, trackVerificationComplete } from "../../Shared/Libs/analytics.utils.js";
|
|
19
|
+
import { useKeepAwake } from "../../Shared/Libs/native-keep-awake.utils.js";
|
|
18
20
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
19
21
|
const {
|
|
20
22
|
width: windowWidth,
|
|
@@ -31,6 +33,7 @@ const PREVIEW_EDGE_OFFSET = 10;
|
|
|
31
33
|
const TURN_ANGLE_LIMIT = 15;
|
|
32
34
|
const LOOK_STRAIGHT_ANGLE_LIMIT = 10;
|
|
33
35
|
const LivenessDetectionScreen = () => {
|
|
36
|
+
useKeepAwake();
|
|
34
37
|
const [camera, setCamera] = useState(null);
|
|
35
38
|
const navigation = useNavigation();
|
|
36
39
|
const appContext = useContext(AppContext);
|
|
@@ -44,6 +47,9 @@ const LivenessDetectionScreen = () => {
|
|
|
44
47
|
|
|
45
48
|
// Track screen view and exit
|
|
46
49
|
useScreenTracking('liveness_detection');
|
|
50
|
+
|
|
51
|
+
// Configure status bar for white background
|
|
52
|
+
useStatusBarWhiteBackground();
|
|
47
53
|
const [initialState, setInitialState] = useState({
|
|
48
54
|
brightnessLow: false,
|
|
49
55
|
faceDetected: false,
|
|
@@ -95,7 +101,21 @@ const LivenessDetectionScreen = () => {
|
|
|
95
101
|
const [instructionList, setInstructionList] = useState([]);
|
|
96
102
|
const [hasGuideShown, setHasGuideShown] = useState(false);
|
|
97
103
|
const stoppingRecordingRef = useRef(false); // Track if we're already stopping to prevent multiple calls
|
|
98
|
-
|
|
104
|
+
|
|
105
|
+
// Configure status bar for white background
|
|
106
|
+
useStatusBarWhiteBackground();
|
|
107
|
+
|
|
108
|
+
// Update status bar when guide visibility changes
|
|
109
|
+
useEffect(() => {
|
|
110
|
+
if (hasGuideShown) {
|
|
111
|
+
// Camera view - use light icons
|
|
112
|
+
StatusBar.setBarStyle('light-content', true);
|
|
113
|
+
} else {
|
|
114
|
+
// Guide screen with white background - use dark icons
|
|
115
|
+
StatusBar.setBarStyle('dark-content', true);
|
|
116
|
+
StatusBar.setBackgroundColor('#ffffff', true);
|
|
117
|
+
}
|
|
118
|
+
}, [hasGuideShown]);
|
|
99
119
|
useEffect(() => {
|
|
100
120
|
const il = Object.keys(instructions).filter(instruction => !['START', 'FINISH'].includes(instruction) && (
|
|
101
121
|
// Look straight and blink is always included
|
|
@@ -115,7 +135,6 @@ const LivenessDetectionScreen = () => {
|
|
|
115
135
|
processComplete: false,
|
|
116
136
|
videoPath: ''
|
|
117
137
|
});
|
|
118
|
-
lastVoiceGuidanceMessage.current = '';
|
|
119
138
|
resetLastMessage();
|
|
120
139
|
}, [instructions, appContext.currentWorkflowStep?.data?.allowedLivenessInstructionTypes]);
|
|
121
140
|
const isCommandInProgress = useRef(false);
|
|
@@ -251,7 +270,6 @@ const LivenessDetectionScreen = () => {
|
|
|
251
270
|
const nextInstruction = state.instructionList[nextInstructionIndex];
|
|
252
271
|
|
|
253
272
|
// Reset TTS state when moving to any new instruction to ensure it speaks
|
|
254
|
-
lastVoiceGuidanceMessage.current = '';
|
|
255
273
|
resetLastMessage();
|
|
256
274
|
|
|
257
275
|
// Calculate progress based on actual action steps (excluding START and FINISH)
|
|
@@ -295,8 +313,7 @@ const LivenessDetectionScreen = () => {
|
|
|
295
313
|
// Let the instruction advance first, then speak the next instruction
|
|
296
314
|
|
|
297
315
|
// Only speak if message changed and is not empty
|
|
298
|
-
if (text
|
|
299
|
-
lastVoiceGuidanceMessage.current = text;
|
|
316
|
+
if (text) {
|
|
300
317
|
// Bypass interval for liveness instructions to ensure all instructions are spoken
|
|
301
318
|
speak(text, true);
|
|
302
319
|
}
|
|
@@ -652,6 +669,9 @@ const LivenessDetectionScreen = () => {
|
|
|
652
669
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
653
670
|
}, []); // Empty array = only run on mount/unmount
|
|
654
671
|
|
|
672
|
+
if (!appContext.currentWorkflowStep || !appContext.currentWorkflowStep.data) {
|
|
673
|
+
return null;
|
|
674
|
+
}
|
|
655
675
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
656
676
|
children: [hasGuideShown ? /*#__PURE__*/_jsxs(_Fragment, {
|
|
657
677
|
children: [/*#__PURE__*/_jsx(FaceCamera, {
|