@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
|
@@ -17,8 +17,10 @@ import {
|
|
|
17
17
|
trackVerificationStart,
|
|
18
18
|
trackVerificationComplete,
|
|
19
19
|
} from '../../Shared/Libs/analytics.utils';
|
|
20
|
+
import { useKeepAwake } from '../../Shared/Libs/native-keep-awake.utils';
|
|
20
21
|
|
|
21
22
|
const IdentityDocumentEIDScanningScreen = () => {
|
|
23
|
+
useKeepAwake();
|
|
22
24
|
const appContext = useContext(AppContext);
|
|
23
25
|
const navigationManagerRef = React.useRef<NavigationManagerRef>(null);
|
|
24
26
|
const insets = useSafeAreaInsets();
|
|
@@ -77,6 +79,10 @@ const IdentityDocumentEIDScanningScreen = () => {
|
|
|
77
79
|
);
|
|
78
80
|
}, [appContext.currentWorkflowStep]);
|
|
79
81
|
|
|
82
|
+
if (!appContext.currentWorkflowStep) {
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
|
|
80
86
|
return (
|
|
81
87
|
<SafeAreaView style={styles.safeAreaContainer}>
|
|
82
88
|
{documentNumber && dateOfBirth && dateOfExpiry ? (
|
|
@@ -17,8 +17,10 @@ import {
|
|
|
17
17
|
trackVerificationStart,
|
|
18
18
|
trackVerificationComplete,
|
|
19
19
|
} from '../../Shared/Libs/analytics.utils';
|
|
20
|
+
import { useKeepAwake } from '../../Shared/Libs/native-keep-awake.utils';
|
|
20
21
|
|
|
21
22
|
const IdentityDocumentScanningScreen = () => {
|
|
23
|
+
useKeepAwake();
|
|
22
24
|
const [idFrontSideData, setIDFrontSideData] =
|
|
23
25
|
useState<DocumentScannedData | null>(null);
|
|
24
26
|
const [idBackSideData, setIDBackSideData] =
|
|
@@ -145,6 +147,10 @@ const IdentityDocumentScanningScreen = () => {
|
|
|
145
147
|
);
|
|
146
148
|
}, [appContext.currentWorkflowStep]);
|
|
147
149
|
|
|
150
|
+
if (!appContext.currentWorkflowStep) {
|
|
151
|
+
return null;
|
|
152
|
+
}
|
|
153
|
+
|
|
148
154
|
return (
|
|
149
155
|
<SafeAreaView style={styles.container}>
|
|
150
156
|
<IdentityDocumentCamera
|
|
@@ -8,7 +8,14 @@ import React, {
|
|
|
8
8
|
useCallback,
|
|
9
9
|
useRef,
|
|
10
10
|
} from 'react';
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
StyleSheet,
|
|
13
|
+
Text,
|
|
14
|
+
View,
|
|
15
|
+
Dimensions,
|
|
16
|
+
Vibration,
|
|
17
|
+
StatusBar,
|
|
18
|
+
} from 'react-native';
|
|
12
19
|
import {
|
|
13
20
|
useSafeAreaInsets,
|
|
14
21
|
SafeAreaView,
|
|
@@ -25,12 +32,14 @@ import { useTranslation } from 'react-i18next';
|
|
|
25
32
|
import StyledButton from '../../Shared/Components/StyledButton';
|
|
26
33
|
import LottieView from 'lottie-react-native';
|
|
27
34
|
import { speak, resetLastMessage } from '../../Shared/Libs/tts.utils';
|
|
35
|
+
import { useStatusBarWhiteBackground } from '../../Shared/Libs/status-bar.utils';
|
|
28
36
|
import {
|
|
29
37
|
trackFunnelStep,
|
|
30
38
|
useScreenTracking,
|
|
31
39
|
trackVerificationStart,
|
|
32
40
|
trackVerificationComplete,
|
|
33
41
|
} from '../../Shared/Libs/analytics.utils';
|
|
42
|
+
import { useKeepAwake } from '../../Shared/Libs/native-keep-awake.utils';
|
|
34
43
|
|
|
35
44
|
const { width: windowWidth, height: windowHeight } = Dimensions.get('window');
|
|
36
45
|
|
|
@@ -78,6 +87,7 @@ type PossibleActions = {
|
|
|
78
87
|
}[keyof Actions];
|
|
79
88
|
|
|
80
89
|
const LivenessDetectionScreen = () => {
|
|
90
|
+
useKeepAwake();
|
|
81
91
|
const [camera, setCamera] = useState<TrustchexCameraHandle | null>(null);
|
|
82
92
|
const navigation = useNavigation();
|
|
83
93
|
const appContext = useContext(AppContext);
|
|
@@ -90,6 +100,9 @@ const LivenessDetectionScreen = () => {
|
|
|
90
100
|
// Track screen view and exit
|
|
91
101
|
useScreenTracking('liveness_detection');
|
|
92
102
|
|
|
103
|
+
// Configure status bar for white background
|
|
104
|
+
useStatusBarWhiteBackground();
|
|
105
|
+
|
|
93
106
|
const [initialState, setInitialState] = useState<StateType>({
|
|
94
107
|
brightnessLow: false,
|
|
95
108
|
faceDetected: false,
|
|
@@ -142,7 +155,21 @@ const LivenessDetectionScreen = () => {
|
|
|
142
155
|
const [instructionList, setInstructionList] = useState<string[]>([]);
|
|
143
156
|
const [hasGuideShown, setHasGuideShown] = useState(false);
|
|
144
157
|
const stoppingRecordingRef = useRef(false); // Track if we're already stopping to prevent multiple calls
|
|
145
|
-
|
|
158
|
+
|
|
159
|
+
// Configure status bar for white background
|
|
160
|
+
useStatusBarWhiteBackground();
|
|
161
|
+
|
|
162
|
+
// Update status bar when guide visibility changes
|
|
163
|
+
useEffect(() => {
|
|
164
|
+
if (hasGuideShown) {
|
|
165
|
+
// Camera view - use light icons
|
|
166
|
+
StatusBar.setBarStyle('light-content', true);
|
|
167
|
+
} else {
|
|
168
|
+
// Guide screen with white background - use dark icons
|
|
169
|
+
StatusBar.setBarStyle('dark-content', true);
|
|
170
|
+
StatusBar.setBackgroundColor('#ffffff', true);
|
|
171
|
+
}
|
|
172
|
+
}, [hasGuideShown]);
|
|
146
173
|
|
|
147
174
|
useEffect(() => {
|
|
148
175
|
const il = Object.keys(instructions)
|
|
@@ -175,7 +202,6 @@ const LivenessDetectionScreen = () => {
|
|
|
175
202
|
processComplete: false,
|
|
176
203
|
videoPath: '',
|
|
177
204
|
});
|
|
178
|
-
lastVoiceGuidanceMessage.current = '';
|
|
179
205
|
resetLastMessage();
|
|
180
206
|
}, [
|
|
181
207
|
instructions,
|
|
@@ -350,7 +376,6 @@ const LivenessDetectionScreen = () => {
|
|
|
350
376
|
const nextInstruction = state.instructionList[nextInstructionIndex];
|
|
351
377
|
|
|
352
378
|
// Reset TTS state when moving to any new instruction to ensure it speaks
|
|
353
|
-
lastVoiceGuidanceMessage.current = '';
|
|
354
379
|
resetLastMessage();
|
|
355
380
|
|
|
356
381
|
// Calculate progress based on actual action steps (excluding START and FINISH)
|
|
@@ -404,8 +429,7 @@ const LivenessDetectionScreen = () => {
|
|
|
404
429
|
// Let the instruction advance first, then speak the next instruction
|
|
405
430
|
|
|
406
431
|
// Only speak if message changed and is not empty
|
|
407
|
-
if (text
|
|
408
|
-
lastVoiceGuidanceMessage.current = text;
|
|
432
|
+
if (text) {
|
|
409
433
|
// Bypass interval for liveness instructions to ensure all instructions are spoken
|
|
410
434
|
speak(text, true);
|
|
411
435
|
}
|
|
@@ -818,6 +842,10 @@ const LivenessDetectionScreen = () => {
|
|
|
818
842
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
819
843
|
}, []); // Empty array = only run on mount/unmount
|
|
820
844
|
|
|
845
|
+
if (!appContext.currentWorkflowStep || !appContext.currentWorkflowStep.data) {
|
|
846
|
+
return null;
|
|
847
|
+
}
|
|
848
|
+
|
|
821
849
|
return (
|
|
822
850
|
<>
|
|
823
851
|
{hasGuideShown ? (
|