@trustchex/react-native-sdk 1.381.0 → 1.464.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.
Files changed (204) hide show
  1. package/android/src/main/java/com/trustchex/reactnativesdk/TrustchexSDKModule.kt +2 -8
  2. package/android/src/main/java/com/trustchex/reactnativesdk/camera/TrustchexCameraView.kt +60 -13
  3. package/android/src/main/java/com/trustchex/reactnativesdk/mlkit/MLKitModule.kt +1 -1
  4. package/ios/Camera/TrustchexCameraView.swift +10 -13
  5. package/ios/MLKit/MLKitModule.swift +1 -1
  6. package/lib/module/Screens/Debug/BarcodeTestScreen.js +308 -0
  7. package/lib/module/Screens/Debug/MRZTestScreen.js +105 -13
  8. package/lib/module/Screens/Debug/NFCScanTestScreen.js +635 -0
  9. package/lib/module/Screens/Dynamic/ContractAcceptanceScreen.js +49 -32
  10. package/lib/module/Screens/Dynamic/IdentityDocumentEIDScanningScreen.js +22 -4
  11. package/lib/module/Screens/Dynamic/IdentityDocumentScanningScreen.js +5 -0
  12. package/lib/module/Screens/Dynamic/LivenessDetectionScreen.js +126 -27
  13. package/lib/module/Screens/Dynamic/VerbalConsentScreen.js +1079 -0
  14. package/lib/module/Screens/Dynamic/VideoCallScreen.js +678 -0
  15. package/lib/module/Screens/Static/OTPVerificationScreen.js +6 -0
  16. package/lib/module/Screens/Static/QrCodeScanningScreen.js +7 -1
  17. package/lib/module/Screens/Static/ResultScreen.js +154 -34
  18. package/lib/module/Screens/Static/VerificationSessionCheckScreen.js +59 -51
  19. package/lib/module/Shared/Animations/recording.json +1 -0
  20. package/lib/module/Shared/Animations/video-call.json +1 -0
  21. package/lib/module/Shared/Components/DebugNavigationPanel.js +231 -67
  22. package/lib/module/Shared/Components/EIDScanner.js +213 -112
  23. package/lib/module/Shared/Components/IdentityDocumentCamera.flows.js +5 -3
  24. package/lib/module/Shared/Components/IdentityDocumentCamera.js +77 -39
  25. package/lib/module/Shared/Components/IdentityDocumentCamera.utils.js +13 -4
  26. package/lib/module/Shared/Components/NavigationManager.js +39 -19
  27. package/lib/module/Shared/Contexts/AppContext.js +1 -0
  28. package/lib/module/Shared/EIDReader/aesSecureMessagingWrapper.js +51 -0
  29. package/lib/module/Shared/EIDReader/apduLevelPACECapable.js +3 -0
  30. package/lib/module/Shared/EIDReader/bacKey.js +16 -2
  31. package/lib/module/Shared/EIDReader/eidReader.js +354 -13
  32. package/lib/module/Shared/EIDReader/eidService.js +25 -1
  33. package/lib/module/Shared/EIDReader/nfcManagerCardService.js +4 -7
  34. package/lib/module/Shared/EIDReader/paceInfo.js +85 -0
  35. package/lib/module/Shared/EIDReader/paceKeySpec.js +51 -0
  36. package/lib/module/Shared/EIDReader/protocol/paceAPDUSender.js +100 -0
  37. package/lib/module/Shared/EIDReader/protocol/paceProtocol.js +655 -0
  38. package/lib/module/Shared/EIDReader/protocol/paceResult.js +37 -0
  39. package/lib/module/Shared/EIDReader/secureMessagingWrapper.js +27 -4
  40. package/lib/module/Shared/EIDReader/smartcards/commandAPDU.js +2 -1
  41. package/lib/module/Shared/EIDReader/tlv/tlv.helpers.js +1 -1
  42. package/lib/module/Shared/EIDReader/tlv/tlv.utils.js +6 -3
  43. package/lib/module/Shared/EIDReader/utils/aesCrypto.utils.js +189 -0
  44. package/lib/module/Shared/Libs/SignalingClient.js +128 -0
  45. package/lib/module/Shared/Libs/analytics.utils.js +8 -0
  46. package/lib/module/Shared/Libs/contains.js +1 -40
  47. package/lib/module/Shared/Libs/country-display.utils.js +34 -0
  48. package/lib/module/Shared/Libs/deeplink.utils.js +9 -1
  49. package/lib/module/Shared/Libs/demo.utils.js +8 -0
  50. package/lib/module/Shared/Libs/http-client.js +9 -0
  51. package/lib/module/Shared/Libs/mrz.utils.js +3 -2
  52. package/lib/module/Shared/Libs/promise.utils.js +16 -2
  53. package/lib/module/Shared/Libs/status-bar.utils.js +23 -0
  54. package/lib/module/Shared/Services/DataUploadService.js +294 -0
  55. package/lib/module/Shared/Services/VideoSessionService.js +156 -0
  56. package/lib/module/Shared/Services/WebRTCService.js +510 -0
  57. package/lib/module/Shared/Types/analytics.types.js +4 -0
  58. package/lib/module/Translation/Resources/en.js +61 -2
  59. package/lib/module/Translation/Resources/tr.js +61 -2
  60. package/lib/module/Trustchex.js +64 -20
  61. package/lib/module/version.js +1 -1
  62. package/lib/typescript/src/Screens/Debug/BarcodeTestScreen.d.ts +3 -0
  63. package/lib/typescript/src/Screens/Debug/BarcodeTestScreen.d.ts.map +1 -0
  64. package/lib/typescript/src/Screens/Debug/MRZTestScreen.d.ts.map +1 -1
  65. package/lib/typescript/src/Screens/Debug/NFCScanTestScreen.d.ts +3 -0
  66. package/lib/typescript/src/Screens/Debug/NFCScanTestScreen.d.ts.map +1 -0
  67. package/lib/typescript/src/Screens/Dynamic/ContractAcceptanceScreen.d.ts.map +1 -1
  68. package/lib/typescript/src/Screens/Dynamic/IdentityDocumentEIDScanningScreen.d.ts.map +1 -1
  69. package/lib/typescript/src/Screens/Dynamic/IdentityDocumentScanningScreen.d.ts.map +1 -1
  70. package/lib/typescript/src/Screens/Dynamic/LivenessDetectionScreen.d.ts.map +1 -1
  71. package/lib/typescript/src/Screens/Dynamic/VerbalConsentScreen.d.ts +3 -0
  72. package/lib/typescript/src/Screens/Dynamic/VerbalConsentScreen.d.ts.map +1 -0
  73. package/lib/typescript/src/Screens/Dynamic/VideoCallScreen.d.ts +3 -0
  74. package/lib/typescript/src/Screens/Dynamic/VideoCallScreen.d.ts.map +1 -0
  75. package/lib/typescript/src/Screens/Static/OTPVerificationScreen.d.ts.map +1 -1
  76. package/lib/typescript/src/Screens/Static/QrCodeScanningScreen.d.ts.map +1 -1
  77. package/lib/typescript/src/Screens/Static/ResultScreen.d.ts.map +1 -1
  78. package/lib/typescript/src/Screens/Static/VerificationSessionCheckScreen.d.ts.map +1 -1
  79. package/lib/typescript/src/Shared/Components/DebugNavigationPanel.d.ts.map +1 -1
  80. package/lib/typescript/src/Shared/Components/EIDScanner.d.ts.map +1 -1
  81. package/lib/typescript/src/Shared/Components/IdentityDocumentCamera.d.ts.map +1 -1
  82. package/lib/typescript/src/Shared/Components/IdentityDocumentCamera.flows.d.ts +1 -1
  83. package/lib/typescript/src/Shared/Components/IdentityDocumentCamera.flows.d.ts.map +1 -1
  84. package/lib/typescript/src/Shared/Components/IdentityDocumentCamera.utils.d.ts +5 -0
  85. package/lib/typescript/src/Shared/Components/IdentityDocumentCamera.utils.d.ts.map +1 -1
  86. package/lib/typescript/src/Shared/Components/NavigationManager.d.ts.map +1 -1
  87. package/lib/typescript/src/Shared/Contexts/AppContext.d.ts +1 -0
  88. package/lib/typescript/src/Shared/Contexts/AppContext.d.ts.map +1 -1
  89. package/lib/typescript/src/Shared/EIDReader/aesSecureMessagingWrapper.d.ts +18 -0
  90. package/lib/typescript/src/Shared/EIDReader/aesSecureMessagingWrapper.d.ts.map +1 -0
  91. package/lib/typescript/src/Shared/EIDReader/apduLevelPACECapable.d.ts +23 -0
  92. package/lib/typescript/src/Shared/EIDReader/apduLevelPACECapable.d.ts.map +1 -0
  93. package/lib/typescript/src/Shared/EIDReader/bacKey.d.ts +6 -0
  94. package/lib/typescript/src/Shared/EIDReader/bacKey.d.ts.map +1 -1
  95. package/lib/typescript/src/Shared/EIDReader/eidReader.d.ts.map +1 -1
  96. package/lib/typescript/src/Shared/EIDReader/eidService.d.ts +9 -0
  97. package/lib/typescript/src/Shared/EIDReader/eidService.d.ts.map +1 -1
  98. package/lib/typescript/src/Shared/EIDReader/nfcManagerCardService.d.ts.map +1 -1
  99. package/lib/typescript/src/Shared/EIDReader/paceInfo.d.ts +50 -0
  100. package/lib/typescript/src/Shared/EIDReader/paceInfo.d.ts.map +1 -0
  101. package/lib/typescript/src/Shared/EIDReader/paceKeySpec.d.ts +30 -0
  102. package/lib/typescript/src/Shared/EIDReader/paceKeySpec.d.ts.map +1 -0
  103. package/lib/typescript/src/Shared/EIDReader/protocol/paceAPDUSender.d.ts +17 -0
  104. package/lib/typescript/src/Shared/EIDReader/protocol/paceAPDUSender.d.ts.map +1 -0
  105. package/lib/typescript/src/Shared/EIDReader/protocol/paceProtocol.d.ts +105 -0
  106. package/lib/typescript/src/Shared/EIDReader/protocol/paceProtocol.d.ts.map +1 -0
  107. package/lib/typescript/src/Shared/EIDReader/protocol/paceResult.d.ts +24 -0
  108. package/lib/typescript/src/Shared/EIDReader/protocol/paceResult.d.ts.map +1 -0
  109. package/lib/typescript/src/Shared/EIDReader/secureMessagingWrapper.d.ts +15 -0
  110. package/lib/typescript/src/Shared/EIDReader/secureMessagingWrapper.d.ts.map +1 -1
  111. package/lib/typescript/src/Shared/EIDReader/smartcards/commandAPDU.d.ts.map +1 -1
  112. package/lib/typescript/src/Shared/EIDReader/tlv/tlv.utils.d.ts.map +1 -1
  113. package/lib/typescript/src/Shared/EIDReader/utils/aesCrypto.utils.d.ts +39 -0
  114. package/lib/typescript/src/Shared/EIDReader/utils/aesCrypto.utils.d.ts.map +1 -0
  115. package/lib/typescript/src/Shared/Libs/SignalingClient.d.ts +24 -0
  116. package/lib/typescript/src/Shared/Libs/SignalingClient.d.ts.map +1 -0
  117. package/lib/typescript/src/Shared/Libs/analytics.utils.d.ts.map +1 -1
  118. package/lib/typescript/src/Shared/Libs/contains.d.ts +0 -7
  119. package/lib/typescript/src/Shared/Libs/contains.d.ts.map +1 -1
  120. package/lib/typescript/src/Shared/Libs/country-display.utils.d.ts +2 -0
  121. package/lib/typescript/src/Shared/Libs/country-display.utils.d.ts.map +1 -0
  122. package/lib/typescript/src/Shared/Libs/deeplink.utils.d.ts.map +1 -1
  123. package/lib/typescript/src/Shared/Libs/demo.utils.d.ts.map +1 -1
  124. package/lib/typescript/src/Shared/Libs/http-client.d.ts +1 -1
  125. package/lib/typescript/src/Shared/Libs/http-client.d.ts.map +1 -1
  126. package/lib/typescript/src/Shared/Libs/mrz.utils.d.ts.map +1 -1
  127. package/lib/typescript/src/Shared/Libs/promise.utils.d.ts.map +1 -1
  128. package/lib/typescript/src/Shared/Libs/status-bar.utils.d.ts +9 -0
  129. package/lib/typescript/src/Shared/Libs/status-bar.utils.d.ts.map +1 -0
  130. package/lib/typescript/src/Shared/Services/DataUploadService.d.ts +25 -0
  131. package/lib/typescript/src/Shared/Services/DataUploadService.d.ts.map +1 -0
  132. package/lib/typescript/src/Shared/Services/VideoSessionService.d.ts +33 -0
  133. package/lib/typescript/src/Shared/Services/VideoSessionService.d.ts.map +1 -0
  134. package/lib/typescript/src/Shared/Services/WebRTCService.d.ts +58 -0
  135. package/lib/typescript/src/Shared/Services/WebRTCService.d.ts.map +1 -0
  136. package/lib/typescript/src/Shared/Types/analytics.types.d.ts +4 -0
  137. package/lib/typescript/src/Shared/Types/analytics.types.d.ts.map +1 -1
  138. package/lib/typescript/src/Shared/Types/identificationInfo.d.ts +13 -1
  139. package/lib/typescript/src/Shared/Types/identificationInfo.d.ts.map +1 -1
  140. package/lib/typescript/src/Translation/Resources/en.d.ts +60 -1
  141. package/lib/typescript/src/Translation/Resources/en.d.ts.map +1 -1
  142. package/lib/typescript/src/Translation/Resources/tr.d.ts +60 -1
  143. package/lib/typescript/src/Translation/Resources/tr.d.ts.map +1 -1
  144. package/lib/typescript/src/Trustchex.d.ts.map +1 -1
  145. package/lib/typescript/src/version.d.ts +1 -1
  146. package/package.json +35 -5
  147. package/src/Screens/Debug/BarcodeTestScreen.tsx +317 -0
  148. package/src/Screens/Debug/MRZTestScreen.tsx +107 -13
  149. package/src/Screens/Debug/NFCScanTestScreen.tsx +692 -0
  150. package/src/Screens/Dynamic/ContractAcceptanceScreen.tsx +58 -35
  151. package/src/Screens/Dynamic/IdentityDocumentEIDScanningScreen.tsx +27 -4
  152. package/src/Screens/Dynamic/IdentityDocumentScanningScreen.tsx +6 -0
  153. package/src/Screens/Dynamic/LivenessDetectionScreen.tsx +156 -27
  154. package/src/Screens/Dynamic/VerbalConsentScreen.tsx +1401 -0
  155. package/src/Screens/Dynamic/VideoCallScreen.tsx +766 -0
  156. package/src/Screens/Static/OTPVerificationScreen.tsx +6 -0
  157. package/src/Screens/Static/QrCodeScanningScreen.tsx +7 -1
  158. package/src/Screens/Static/ResultScreen.tsx +235 -48
  159. package/src/Screens/Static/VerificationSessionCheckScreen.tsx +67 -72
  160. package/src/Shared/Animations/recording.json +1 -0
  161. package/src/Shared/Animations/video-call.json +1 -0
  162. package/src/Shared/Components/DebugNavigationPanel.tsx +252 -51
  163. package/src/Shared/Components/EIDScanner.tsx +223 -116
  164. package/src/Shared/Components/IdentityDocumentCamera.flows.ts +7 -4
  165. package/src/Shared/Components/IdentityDocumentCamera.tsx +224 -188
  166. package/src/Shared/Components/IdentityDocumentCamera.utils.ts +13 -4
  167. package/src/Shared/Components/NavigationManager.tsx +41 -19
  168. package/src/Shared/Contexts/AppContext.ts +2 -0
  169. package/src/Shared/EIDReader/aesSecureMessagingWrapper.ts +69 -0
  170. package/src/Shared/EIDReader/apduLevelPACECapable.ts +34 -0
  171. package/src/Shared/EIDReader/bacKey.ts +24 -8
  172. package/src/Shared/EIDReader/eidReader.ts +398 -12
  173. package/src/Shared/EIDReader/eidService.ts +49 -1
  174. package/src/Shared/EIDReader/nfcManagerCardService.ts +4 -6
  175. package/src/Shared/EIDReader/paceInfo.ts +159 -0
  176. package/src/Shared/EIDReader/paceKeySpec.ts +56 -0
  177. package/src/Shared/EIDReader/protocol/paceAPDUSender.ts +163 -0
  178. package/src/Shared/EIDReader/protocol/paceProtocol.ts +946 -0
  179. package/src/Shared/EIDReader/protocol/paceResult.ts +62 -0
  180. package/src/Shared/EIDReader/secureMessagingWrapper.ts +28 -10
  181. package/src/Shared/EIDReader/smartcards/commandAPDU.ts +2 -1
  182. package/src/Shared/EIDReader/tlv/tlv.helpers.ts +1 -1
  183. package/src/Shared/EIDReader/tlv/tlv.utils.ts +8 -5
  184. package/src/Shared/EIDReader/utils/aesCrypto.utils.ts +217 -0
  185. package/src/Shared/Libs/SignalingClient.ts +189 -0
  186. package/src/Shared/Libs/analytics.utils.ts +8 -0
  187. package/src/Shared/Libs/contains.ts +0 -53
  188. package/src/Shared/Libs/country-display.utils.ts +55 -0
  189. package/src/Shared/Libs/crypto.utils.ts +2 -2
  190. package/src/Shared/Libs/deeplink.utils.ts +12 -1
  191. package/src/Shared/Libs/demo.utils.ts +10 -0
  192. package/src/Shared/Libs/http-client.ts +19 -1
  193. package/src/Shared/Libs/mrz.utils.ts +3 -2
  194. package/src/Shared/Libs/promise.utils.ts +16 -2
  195. package/src/Shared/Libs/status-bar.utils.ts +21 -0
  196. package/src/Shared/Services/DataUploadService.ts +395 -0
  197. package/src/Shared/Services/VideoSessionService.ts +190 -0
  198. package/src/Shared/Services/WebRTCService.ts +636 -0
  199. package/src/Shared/Types/analytics.types.ts +4 -0
  200. package/src/Shared/Types/identificationInfo.ts +16 -1
  201. package/src/Translation/Resources/en.ts +88 -3
  202. package/src/Translation/Resources/tr.ts +89 -3
  203. package/src/Trustchex.tsx +65 -19
  204. package/src/version.ts +1 -1
@@ -1,39 +1,33 @@
1
1
  "use strict";
2
2
 
3
3
  import React, { useCallback, useContext, useState } from 'react';
4
- import { View, Text, TouchableOpacity, StyleSheet, Platform, Switch } from 'react-native';
4
+ import { View, Text, TouchableOpacity, StyleSheet, Platform, Switch, ActivityIndicator } from 'react-native';
5
5
  import { useNavigation } from '@react-navigation/native';
6
6
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
7
+ import { useTranslation } from 'react-i18next';
7
8
  import AppContext from "../Contexts/AppContext.js";
8
9
  import { getSimulatedDemoData } from "../Libs/demo.utils.js";
9
10
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
10
- // Icon mapping matching Flutter SDK Material Icons
11
- const ICONS = {
12
- LOGIN: '',
13
- // Icons.login - Locked with key for session security
14
- HANDSHAKE: '📝',
15
- // Icons.handshake - Document for contract signing
16
- CREDIT_CARD: '🪪',
17
- // Icons.credit_card - ID card for document scan
18
- NFC: '💳',
19
- // Icons.nfc - Contactless card for eID
20
- FACE: '📸',
21
- // Icons.face - Camera for face detection
22
- CHECK_CIRCLE: '📋',
23
- // Icons.check_circle - Clipboard for results
24
- BUG_REPORT: '🔧',
25
- // Icons.bug_report - Wrench for debugging
26
- PHONE: '💬' // Icons.phone - Message for OTP code
27
- };
11
+ const DEV_BASE_URL = 'https://192.168.0.171:3000';
12
+ const DEBUG_VERBAL_CONSENT_TITLE_EN = 'Verbal Consent';
13
+ const DEBUG_VERBAL_CONSENT_TITLE_TR = 'Sözlü Onay';
14
+ const DEBUG_VERBAL_CONSENT_TEXT_EN = 'I confirm my identity and give my explicit consent to the processing of my personal data for digital identity verification. I acknowledge that my biometric data will be used solely for this purpose. I understand that I can withdraw this consent at any time.';
15
+ const DEBUG_VERBAL_CONSENT_TEXT_TR = 'Dijital kimlik doğrulama amacıyla kimliğimi teyit ediyor ve kişisel verilerimin işlenmesine açık rızamı veriyorum. Biyometrik verilerimin yalnızca kimlik doğrulama amacıyla işleneceğini kabul ediyorum. Bu onayı istediğim zaman geri çekebileceğimi biliyorum.';
28
16
  const DebugNavigationPanel = () => {
29
17
  const [isExpanded, setIsExpanded] = useState(false);
30
18
  const [selectedScreen, setSelectedScreen] = useState(null);
31
19
  const [voiceGuidanceEnabled, setVoiceGuidanceEnabled] = useState(true);
32
20
  const [allowIdCard, setAllowIdCard] = useState(true);
33
21
  const [allowPassport, setAllowPassport] = useState(true);
22
+ const [isConnectingVideoCall, setIsConnectingVideoCall] = useState(false);
23
+ const [videoCallError, setVideoCallError] = useState(null);
34
24
  const navigation = useNavigation();
35
25
  const appContext = useContext(AppContext);
36
26
  const insets = useSafeAreaInsets();
27
+ const {
28
+ i18n
29
+ } = useTranslation();
30
+ const isTurkish = (i18n.language || '').toLowerCase().startsWith('tr');
37
31
  const setupDemoSession = useCallback((setDebugFlag = false) => {
38
32
  appContext.setIsDemoSession?.(true);
39
33
  appContext.identificationInfo.sessionId = 'demo-verification-id';
@@ -78,12 +72,10 @@ const DebugNavigationPanel = () => {
78
72
  }, [appContext]);
79
73
  const screens = [{
80
74
  screen: 'VerificationSessionCheckScreen',
81
- label: 'Session Check',
82
- icon: ICONS.LOGIN
75
+ label: 'Session Check'
83
76
  }, {
84
77
  screen: 'OTPVerificationScreen',
85
78
  label: 'OTP',
86
- icon: ICONS.PHONE,
87
79
  setupDemo: () => {
88
80
  setupDemoSession(true);
89
81
  },
@@ -93,7 +85,6 @@ const DebugNavigationPanel = () => {
93
85
  }, {
94
86
  screen: 'ContractAcceptanceScreen',
95
87
  label: 'Consent',
96
- icon: ICONS.HANDSHAKE,
97
88
  hasOptions: true,
98
89
  setupDemo: () => {
99
90
  setupDemoSession(true);
@@ -103,10 +94,40 @@ const DebugNavigationPanel = () => {
103
94
  appContext.currentWorkflowStep = contractStep;
104
95
  }
105
96
  }
97
+ }, {
98
+ screen: 'VerbalConsentScreen',
99
+ label: 'Verbal Consent',
100
+ hasOptions: true,
101
+ setupDemo: () => {
102
+ setupDemoSession(true);
103
+ const existingStep = appContext.workflowSteps?.find(s => s.type === 'VERBAL_CONSENT');
104
+ const localizedConsentTitle = isTurkish ? DEBUG_VERBAL_CONSENT_TITLE_TR : DEBUG_VERBAL_CONSENT_TITLE_EN;
105
+ const localizedConsentText = isTurkish ? DEBUG_VERBAL_CONSENT_TEXT_TR : DEBUG_VERBAL_CONSENT_TEXT_EN;
106
+ const localizedStep = existingStep ? {
107
+ ...existingStep,
108
+ data: {
109
+ ...existingStep.data,
110
+ verbalConsentTitle: localizedConsentTitle,
111
+ verbalConsentText: localizedConsentText,
112
+ voiceGuidanceActive: false
113
+ }
114
+ } : {
115
+ type: 'VERBAL_CONSENT',
116
+ required: true,
117
+ data: {
118
+ verbalConsentTitle: localizedConsentTitle,
119
+ verbalConsentText: localizedConsentText,
120
+ voiceGuidanceActive: false
121
+ }
122
+ };
123
+ if (appContext.workflowSteps) {
124
+ appContext.workflowSteps = appContext.workflowSteps.map(step => step.type === 'VERBAL_CONSENT' ? localizedStep : step);
125
+ }
126
+ appContext.currentWorkflowStep = localizedStep;
127
+ }
106
128
  }, {
107
129
  screen: 'IdentityDocumentScanningScreen',
108
130
  label: 'ID Scan',
109
- icon: ICONS.CREDIT_CARD,
110
131
  hasOptions: true,
111
132
  hasDocumentTypeOption: true,
112
133
  setupDemo: () => {
@@ -119,7 +140,6 @@ const DebugNavigationPanel = () => {
119
140
  }, {
120
141
  screen: 'IdentityDocumentEIDScanningScreen',
121
142
  label: 'eID Scan',
122
- icon: ICONS.NFC,
123
143
  hasOptions: true,
124
144
  hasDocumentTypeOption: true,
125
145
  setupDemo: () => {
@@ -132,7 +152,6 @@ const DebugNavigationPanel = () => {
132
152
  }, {
133
153
  screen: 'LivenessDetectionScreen',
134
154
  label: 'Liveness',
135
- icon: ICONS.FACE,
136
155
  hasOptions: true,
137
156
  setupDemo: () => {
138
157
  setupDemoSession(true);
@@ -144,19 +163,27 @@ const DebugNavigationPanel = () => {
144
163
  }, {
145
164
  screen: 'ResultScreen',
146
165
  label: 'Result',
147
- icon: ICONS.CHECK_CIRCLE,
148
166
  setupDemo: () => {
149
167
  setupDemoSession();
150
168
  }
151
169
  }, {
152
170
  screen: 'MRZTestScreen',
153
171
  label: 'MRZ Test',
154
- icon: ICONS.BUG_REPORT
172
+ isDebug: true
173
+ }, {
174
+ screen: 'BarcodeTestScreen',
175
+ label: 'Barcode Test',
176
+ isDebug: true
177
+ }, {
178
+ screen: 'NFCScanTestScreen',
179
+ label: 'NFC Scan Test',
180
+ isDebug: true
155
181
  }];
156
182
  const selectScreen = useCallback(screen => {
157
183
  if (!screen.hasOptions) {
158
184
  if (screen.setupDemo) {
159
185
  screen.setupDemo();
186
+ applyVoiceGuidance(voiceGuidanceEnabled);
160
187
  }
161
188
  navigation.navigate(screen.screen, screen.params);
162
189
  setIsExpanded(false);
@@ -166,10 +193,64 @@ const DebugNavigationPanel = () => {
166
193
  setVoiceGuidanceEnabled(true);
167
194
  setAllowIdCard(true);
168
195
  setAllowPassport(true);
169
- }, [navigation]);
170
- const jumpToScreen = useCallback(() => {
171
- if (!selectedScreen) return;
196
+ }, [navigation, voiceGuidanceEnabled, applyVoiceGuidance]);
197
+ const handleVideoCallTest = useCallback(async () => {
198
+ setIsConnectingVideoCall(true);
199
+ setVideoCallError(null);
200
+ try {
201
+ const fallbackUrl = (appContext.baseUrl ?? '').replace(/\/$/, '');
202
+ let response;
203
+ let usedBaseUrl = DEV_BASE_URL;
204
+ try {
205
+ response = await fetch(`${DEV_BASE_URL}/api/test/video-sessions/latest`);
206
+ } catch {
207
+ usedBaseUrl = fallbackUrl;
208
+ response = await fetch(`${fallbackUrl}/api/test/video-sessions/latest`);
209
+ }
210
+ const text = await response.text();
211
+ let data;
212
+ try {
213
+ data = JSON.parse(text);
214
+ } catch {
215
+ throw new Error(`Server returned non-JSON (${response.status}): ${text.slice(0, 120)}`);
216
+ }
217
+ if (!response.ok || !data.success) {
218
+ throw new Error(data.message || 'No active test session found');
219
+ }
220
+ // Point SDK at the server where the test session lives.
221
+ // Do NOT call setBaseUrl (state setter) — it triggers a useMemo rebuild in
222
+ // Trustchex.tsx that resets identificationInfo to an empty object before the
223
+ // screen can render. Direct mutation is sufficient for the test flow.
224
+ appContext.baseUrl = usedBaseUrl;
225
+ appContext.isTestVideoSession = true;
226
+ appContext.identificationInfo.identificationId = data.identificationId;
227
+ appContext.identificationInfo.videoSessionId = data.videoSessionId;
228
+ appContext.identificationInfo.sessionId = data.verificationSessionId;
172
229
 
230
+ // Set up a mini workflow: eID scan → video call
231
+ const eidStep = {
232
+ type: 'IDENTITY_DOCUMENT_EID_SCAN',
233
+ required: false,
234
+ data: {
235
+ voiceGuidanceActive: false
236
+ }
237
+ };
238
+ const videoCallStep = {
239
+ type: 'VIDEO_CALL',
240
+ required: true,
241
+ data: {}
242
+ };
243
+ appContext.workflowSteps = [eidStep, videoCallStep];
244
+ appContext.currentWorkflowStep = eidStep;
245
+ navigation.navigate('IdentityDocumentEIDScanningScreen');
246
+ setIsExpanded(false);
247
+ } catch (err) {
248
+ setVideoCallError(err.message || 'Failed to connect');
249
+ } finally {
250
+ setIsConnectingVideoCall(false);
251
+ }
252
+ }, [appContext, navigation]);
253
+ const jumpToScreen = useCallback(() => {
173
254
  // Validate document type selection for document scanning screens
174
255
  if (selectedScreen.hasDocumentTypeOption && !allowIdCard && !allowPassport) {
175
256
  // Don't navigate if no document types are selected
@@ -206,14 +287,14 @@ const DebugNavigationPanel = () => {
206
287
  style: styles.title,
207
288
  children: "SDK JUMP TO SCREEN:"
208
289
  }), selectedScreen ? /*#__PURE__*/_jsxs(View, {
209
- children: [/*#__PURE__*/_jsxs(Text, {
290
+ children: [/*#__PURE__*/_jsx(Text, {
210
291
  style: styles.optionsTitle,
211
- children: [selectedScreen.icon, " ", selectedScreen.label]
292
+ children: selectedScreen.label
212
293
  }), /*#__PURE__*/_jsxs(View, {
213
294
  style: styles.optionRow,
214
295
  children: [/*#__PURE__*/_jsx(Text, {
215
296
  style: styles.optionLabel,
216
- children: "\uD83D\uDD0A Voice Guidance"
297
+ children: "Voice Guidance"
217
298
  }), /*#__PURE__*/_jsx(Switch, {
218
299
  value: voiceGuidanceEnabled,
219
300
  onValueChange: setVoiceGuidanceEnabled,
@@ -228,7 +309,7 @@ const DebugNavigationPanel = () => {
228
309
  style: styles.optionRow,
229
310
  children: [/*#__PURE__*/_jsx(Text, {
230
311
  style: styles.optionLabel,
231
- children: "\uD83E\uDEAA Allow ID Card"
312
+ children: "Allow ID Card"
232
313
  }), /*#__PURE__*/_jsx(Switch, {
233
314
  value: allowIdCard,
234
315
  onValueChange: setAllowIdCard,
@@ -242,7 +323,7 @@ const DebugNavigationPanel = () => {
242
323
  style: styles.optionRow,
243
324
  children: [/*#__PURE__*/_jsx(Text, {
244
325
  style: styles.optionLabel,
245
- children: "\uD83D\uDEC2 Allow Passport"
326
+ children: "Allow Passport"
246
327
  }), /*#__PURE__*/_jsx(Switch, {
247
328
  value: allowPassport,
248
329
  onValueChange: setAllowPassport,
@@ -272,17 +353,47 @@ const DebugNavigationPanel = () => {
272
353
  })
273
354
  })]
274
355
  })]
275
- }) : screens.map(screen => /*#__PURE__*/_jsxs(TouchableOpacity, {
276
- style: styles.screenButton,
277
- onPress: () => selectScreen(screen),
278
- children: [/*#__PURE__*/_jsx(Text, {
279
- style: styles.screenIcon,
280
- children: screen.icon
281
- }), /*#__PURE__*/_jsx(Text, {
282
- style: styles.screenLabel,
283
- children: screen.label
356
+ }) : /*#__PURE__*/_jsxs(_Fragment, {
357
+ children: [screens.filter(s => !s.isDebug).map(screen => /*#__PURE__*/_jsx(TouchableOpacity, {
358
+ style: styles.screenButton,
359
+ onPress: () => selectScreen(screen),
360
+ children: /*#__PURE__*/_jsx(Text, {
361
+ style: styles.screenLabel,
362
+ children: screen.label
363
+ })
364
+ }, screen.screen)), /*#__PURE__*/_jsxs(View, {
365
+ style: styles.sectionDivider,
366
+ children: [/*#__PURE__*/_jsx(View, {
367
+ style: styles.sectionDividerLine
368
+ }), /*#__PURE__*/_jsx(Text, {
369
+ style: styles.sectionDividerLabel,
370
+ children: "DEBUG TOOLS"
371
+ }), /*#__PURE__*/_jsx(View, {
372
+ style: styles.sectionDividerLine
373
+ })]
374
+ }), screens.filter(s => s.isDebug).map(screen => /*#__PURE__*/_jsx(TouchableOpacity, {
375
+ style: styles.debugScreenButton,
376
+ onPress: () => selectScreen(screen),
377
+ children: /*#__PURE__*/_jsx(Text, {
378
+ style: styles.debugScreenLabel,
379
+ children: screen.label
380
+ })
381
+ }, screen.screen)), /*#__PURE__*/_jsxs(TouchableOpacity, {
382
+ style: [styles.videoCallTestButton, isConnectingVideoCall && styles.videoCallTestButtonDisabled],
383
+ onPress: handleVideoCallTest,
384
+ disabled: isConnectingVideoCall,
385
+ children: [isConnectingVideoCall && /*#__PURE__*/_jsx(ActivityIndicator, {
386
+ size: "small",
387
+ color: "#4CAF50"
388
+ }), /*#__PURE__*/_jsx(Text, {
389
+ style: styles.videoCallTestLabel,
390
+ children: isConnectingVideoCall ? 'Connecting...' : 'Video Call Test'
391
+ })]
392
+ }), videoCallError && /*#__PURE__*/_jsx(Text, {
393
+ style: styles.videoCallTestError,
394
+ children: videoCallError
284
395
  })]
285
- }, screen.screen))]
396
+ })]
286
397
  }), /*#__PURE__*/_jsxs(TouchableOpacity, {
287
398
  style: styles.toggleButton,
288
399
  onPress: () => {
@@ -292,18 +403,13 @@ const DebugNavigationPanel = () => {
292
403
  setAllowIdCard(true);
293
404
  setAllowPassport(true);
294
405
  },
295
- children: [/*#__PURE__*/_jsx(Text, {
296
- style: styles.bugIcon,
297
- children: ICONS.BUG_REPORT
298
- }), isExpanded && /*#__PURE__*/_jsxs(_Fragment, {
299
- children: [/*#__PURE__*/_jsx(View, {
300
- style: styles.spacing
301
- }), /*#__PURE__*/_jsx(Text, {
406
+ children: [isExpanded && /*#__PURE__*/_jsxs(_Fragment, {
407
+ children: [/*#__PURE__*/_jsx(Text, {
302
408
  style: styles.toggleText,
303
409
  children: "DEBUG NAV"
410
+ }), /*#__PURE__*/_jsx(View, {
411
+ style: styles.spacing
304
412
  })]
305
- }), /*#__PURE__*/_jsx(View, {
306
- style: styles.spacing
307
413
  }), /*#__PURE__*/_jsx(Text, {
308
414
  style: styles.arrow,
309
415
  children: isExpanded ? '▼' : '▲'
@@ -322,9 +428,9 @@ const styles = StyleSheet.create({
322
428
  flexDirection: 'row',
323
429
  alignItems: 'center',
324
430
  backgroundColor: '#FF5252',
325
- paddingHorizontal: 12,
431
+ paddingHorizontal: 10,
326
432
  paddingVertical: 10,
327
- borderRadius: 10,
433
+ borderRadius: 8,
328
434
  borderWidth: 2,
329
435
  borderColor: 'white',
330
436
  ...Platform.select({
@@ -342,9 +448,6 @@ const styles = StyleSheet.create({
342
448
  }
343
449
  })
344
450
  },
345
- bugIcon: {
346
- fontSize: 24
347
- },
348
451
  spacing: {
349
452
  width: 8
350
453
  },
@@ -355,7 +458,10 @@ const styles = StyleSheet.create({
355
458
  },
356
459
  arrow: {
357
460
  color: 'white',
358
- fontSize: 20
461
+ fontSize: 20,
462
+ lineHeight: 20,
463
+ textAlignVertical: 'center',
464
+ includeFontPadding: false
359
465
  },
360
466
  panel: {
361
467
  backgroundColor: 'rgba(0, 0, 0, 0.9)',
@@ -398,12 +504,6 @@ const styles = StyleSheet.create({
398
504
  borderRadius: 4,
399
505
  marginBottom: 6
400
506
  },
401
- screenIcon: {
402
- fontSize: 16,
403
- marginRight: 8,
404
- width: 20,
405
- textAlign: 'center'
406
- },
407
507
  screenLabel: {
408
508
  color: 'white',
409
509
  fontSize: 12,
@@ -461,6 +561,70 @@ const styles = StyleSheet.create({
461
561
  },
462
562
  goButtonTextDisabled: {
463
563
  color: '#CCCCCC'
564
+ },
565
+ sectionDivider: {
566
+ flexDirection: 'row',
567
+ alignItems: 'center',
568
+ marginTop: 4,
569
+ marginBottom: 6,
570
+ gap: 6
571
+ },
572
+ sectionDividerLine: {
573
+ flex: 1,
574
+ height: 1,
575
+ backgroundColor: 'rgba(255, 167, 38, 0.4)'
576
+ },
577
+ sectionDividerLabel: {
578
+ color: '#FFA726',
579
+ fontSize: 9,
580
+ fontWeight: 'bold',
581
+ letterSpacing: 1
582
+ },
583
+ debugScreenButton: {
584
+ flexDirection: 'row',
585
+ alignItems: 'center',
586
+ justifyContent: 'flex-start',
587
+ backgroundColor: 'rgba(255, 167, 38, 0.15)',
588
+ borderWidth: 1,
589
+ borderColor: 'rgba(255, 167, 38, 0.4)',
590
+ paddingHorizontal: 12,
591
+ paddingVertical: 8,
592
+ borderRadius: 4,
593
+ marginBottom: 6
594
+ },
595
+ debugScreenLabel: {
596
+ color: '#FFA726',
597
+ fontSize: 12,
598
+ fontWeight: '500',
599
+ flex: 1
600
+ },
601
+ videoCallTestButton: {
602
+ flexDirection: 'row',
603
+ alignItems: 'center',
604
+ justifyContent: 'flex-start',
605
+ backgroundColor: 'rgba(76, 175, 80, 0.15)',
606
+ borderWidth: 1,
607
+ borderColor: 'rgba(76, 175, 80, 0.5)',
608
+ paddingHorizontal: 12,
609
+ paddingVertical: 8,
610
+ borderRadius: 4,
611
+ marginBottom: 6,
612
+ gap: 8
613
+ },
614
+ videoCallTestButtonDisabled: {
615
+ opacity: 0.5
616
+ },
617
+ videoCallTestLabel: {
618
+ color: '#4CAF50',
619
+ fontSize: 12,
620
+ fontWeight: '600',
621
+ flex: 1
622
+ },
623
+ videoCallTestError: {
624
+ color: '#FF5252',
625
+ fontSize: 10,
626
+ marginBottom: 6,
627
+ paddingHorizontal: 4
464
628
  }
465
629
  });
466
630
  export default DebugNavigationPanel;