@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.
- package/android/src/main/java/com/trustchex/reactnativesdk/TrustchexSDKModule.kt +2 -8
- package/android/src/main/java/com/trustchex/reactnativesdk/camera/TrustchexCameraView.kt +60 -13
- package/android/src/main/java/com/trustchex/reactnativesdk/mlkit/MLKitModule.kt +1 -1
- package/ios/Camera/TrustchexCameraView.swift +10 -13
- 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/Debug/NFCScanTestScreen.js +635 -0
- package/lib/module/Screens/Dynamic/ContractAcceptanceScreen.js +49 -32
- package/lib/module/Screens/Dynamic/IdentityDocumentEIDScanningScreen.js +22 -4
- package/lib/module/Screens/Dynamic/IdentityDocumentScanningScreen.js +5 -0
- package/lib/module/Screens/Dynamic/LivenessDetectionScreen.js +126 -27
- package/lib/module/Screens/Dynamic/VerbalConsentScreen.js +1079 -0
- package/lib/module/Screens/Dynamic/VideoCallScreen.js +678 -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 +154 -34
- package/lib/module/Screens/Static/VerificationSessionCheckScreen.js +59 -51
- package/lib/module/Shared/Animations/recording.json +1 -0
- package/lib/module/Shared/Animations/video-call.json +1 -0
- package/lib/module/Shared/Components/DebugNavigationPanel.js +231 -67
- package/lib/module/Shared/Components/EIDScanner.js +213 -112
- package/lib/module/Shared/Components/IdentityDocumentCamera.flows.js +5 -3
- package/lib/module/Shared/Components/IdentityDocumentCamera.js +77 -39
- package/lib/module/Shared/Components/IdentityDocumentCamera.utils.js +13 -4
- package/lib/module/Shared/Components/NavigationManager.js +39 -19
- package/lib/module/Shared/Contexts/AppContext.js +1 -0
- package/lib/module/Shared/EIDReader/aesSecureMessagingWrapper.js +51 -0
- package/lib/module/Shared/EIDReader/apduLevelPACECapable.js +3 -0
- package/lib/module/Shared/EIDReader/bacKey.js +16 -2
- package/lib/module/Shared/EIDReader/eidReader.js +354 -13
- package/lib/module/Shared/EIDReader/eidService.js +25 -1
- package/lib/module/Shared/EIDReader/nfcManagerCardService.js +4 -7
- package/lib/module/Shared/EIDReader/paceInfo.js +85 -0
- package/lib/module/Shared/EIDReader/paceKeySpec.js +51 -0
- package/lib/module/Shared/EIDReader/protocol/paceAPDUSender.js +100 -0
- package/lib/module/Shared/EIDReader/protocol/paceProtocol.js +655 -0
- package/lib/module/Shared/EIDReader/protocol/paceResult.js +37 -0
- package/lib/module/Shared/EIDReader/secureMessagingWrapper.js +27 -4
- package/lib/module/Shared/EIDReader/smartcards/commandAPDU.js +2 -1
- package/lib/module/Shared/EIDReader/tlv/tlv.helpers.js +1 -1
- package/lib/module/Shared/EIDReader/tlv/tlv.utils.js +6 -3
- package/lib/module/Shared/EIDReader/utils/aesCrypto.utils.js +189 -0
- package/lib/module/Shared/Libs/SignalingClient.js +128 -0
- package/lib/module/Shared/Libs/analytics.utils.js +8 -0
- package/lib/module/Shared/Libs/contains.js +1 -40
- package/lib/module/Shared/Libs/country-display.utils.js +34 -0
- package/lib/module/Shared/Libs/deeplink.utils.js +9 -1
- package/lib/module/Shared/Libs/demo.utils.js +8 -0
- package/lib/module/Shared/Libs/http-client.js +9 -0
- package/lib/module/Shared/Libs/mrz.utils.js +3 -2
- package/lib/module/Shared/Libs/promise.utils.js +16 -2
- package/lib/module/Shared/Libs/status-bar.utils.js +23 -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 +4 -0
- package/lib/module/Translation/Resources/en.js +61 -2
- package/lib/module/Translation/Resources/tr.js +61 -2
- package/lib/module/Trustchex.js +64 -20
- 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/Debug/NFCScanTestScreen.d.ts +3 -0
- package/lib/typescript/src/Screens/Debug/NFCScanTestScreen.d.ts.map +1 -0
- 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/VerbalConsentScreen.d.ts +3 -0
- package/lib/typescript/src/Screens/Dynamic/VerbalConsentScreen.d.ts.map +1 -0
- 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/IdentityDocumentCamera.flows.d.ts +1 -1
- package/lib/typescript/src/Shared/Components/IdentityDocumentCamera.flows.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Components/IdentityDocumentCamera.utils.d.ts +5 -0
- package/lib/typescript/src/Shared/Components/IdentityDocumentCamera.utils.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/EIDReader/aesSecureMessagingWrapper.d.ts +18 -0
- package/lib/typescript/src/Shared/EIDReader/aesSecureMessagingWrapper.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/apduLevelPACECapable.d.ts +23 -0
- package/lib/typescript/src/Shared/EIDReader/apduLevelPACECapable.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/bacKey.d.ts +6 -0
- package/lib/typescript/src/Shared/EIDReader/bacKey.d.ts.map +1 -1
- package/lib/typescript/src/Shared/EIDReader/eidReader.d.ts.map +1 -1
- package/lib/typescript/src/Shared/EIDReader/eidService.d.ts +9 -0
- package/lib/typescript/src/Shared/EIDReader/eidService.d.ts.map +1 -1
- package/lib/typescript/src/Shared/EIDReader/nfcManagerCardService.d.ts.map +1 -1
- package/lib/typescript/src/Shared/EIDReader/paceInfo.d.ts +50 -0
- package/lib/typescript/src/Shared/EIDReader/paceInfo.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/paceKeySpec.d.ts +30 -0
- package/lib/typescript/src/Shared/EIDReader/paceKeySpec.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/protocol/paceAPDUSender.d.ts +17 -0
- package/lib/typescript/src/Shared/EIDReader/protocol/paceAPDUSender.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/protocol/paceProtocol.d.ts +105 -0
- package/lib/typescript/src/Shared/EIDReader/protocol/paceProtocol.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/protocol/paceResult.d.ts +24 -0
- package/lib/typescript/src/Shared/EIDReader/protocol/paceResult.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/secureMessagingWrapper.d.ts +15 -0
- package/lib/typescript/src/Shared/EIDReader/secureMessagingWrapper.d.ts.map +1 -1
- package/lib/typescript/src/Shared/EIDReader/smartcards/commandAPDU.d.ts.map +1 -1
- package/lib/typescript/src/Shared/EIDReader/tlv/tlv.utils.d.ts.map +1 -1
- package/lib/typescript/src/Shared/EIDReader/utils/aesCrypto.utils.d.ts +39 -0
- package/lib/typescript/src/Shared/EIDReader/utils/aesCrypto.utils.d.ts.map +1 -0
- 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/contains.d.ts +0 -7
- package/lib/typescript/src/Shared/Libs/contains.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Libs/country-display.utils.d.ts +2 -0
- package/lib/typescript/src/Shared/Libs/country-display.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 +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.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 +4 -0
- package/lib/typescript/src/Shared/Types/analytics.types.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Types/identificationInfo.d.ts +13 -1
- package/lib/typescript/src/Shared/Types/identificationInfo.d.ts.map +1 -1
- package/lib/typescript/src/Translation/Resources/en.d.ts +60 -1
- package/lib/typescript/src/Translation/Resources/en.d.ts.map +1 -1
- package/lib/typescript/src/Translation/Resources/tr.d.ts +60 -1
- 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 +35 -5
- package/src/Screens/Debug/BarcodeTestScreen.tsx +317 -0
- package/src/Screens/Debug/MRZTestScreen.tsx +107 -13
- package/src/Screens/Debug/NFCScanTestScreen.tsx +692 -0
- package/src/Screens/Dynamic/ContractAcceptanceScreen.tsx +58 -35
- package/src/Screens/Dynamic/IdentityDocumentEIDScanningScreen.tsx +27 -4
- package/src/Screens/Dynamic/IdentityDocumentScanningScreen.tsx +6 -0
- package/src/Screens/Dynamic/LivenessDetectionScreen.tsx +156 -27
- package/src/Screens/Dynamic/VerbalConsentScreen.tsx +1401 -0
- package/src/Screens/Dynamic/VideoCallScreen.tsx +766 -0
- package/src/Screens/Static/OTPVerificationScreen.tsx +6 -0
- package/src/Screens/Static/QrCodeScanningScreen.tsx +7 -1
- package/src/Screens/Static/ResultScreen.tsx +235 -48
- package/src/Screens/Static/VerificationSessionCheckScreen.tsx +67 -72
- package/src/Shared/Animations/recording.json +1 -0
- package/src/Shared/Animations/video-call.json +1 -0
- package/src/Shared/Components/DebugNavigationPanel.tsx +252 -51
- package/src/Shared/Components/EIDScanner.tsx +223 -116
- package/src/Shared/Components/IdentityDocumentCamera.flows.ts +7 -4
- package/src/Shared/Components/IdentityDocumentCamera.tsx +224 -188
- package/src/Shared/Components/IdentityDocumentCamera.utils.ts +13 -4
- package/src/Shared/Components/NavigationManager.tsx +41 -19
- package/src/Shared/Contexts/AppContext.ts +2 -0
- package/src/Shared/EIDReader/aesSecureMessagingWrapper.ts +69 -0
- package/src/Shared/EIDReader/apduLevelPACECapable.ts +34 -0
- package/src/Shared/EIDReader/bacKey.ts +24 -8
- package/src/Shared/EIDReader/eidReader.ts +398 -12
- package/src/Shared/EIDReader/eidService.ts +49 -1
- package/src/Shared/EIDReader/nfcManagerCardService.ts +4 -6
- package/src/Shared/EIDReader/paceInfo.ts +159 -0
- package/src/Shared/EIDReader/paceKeySpec.ts +56 -0
- package/src/Shared/EIDReader/protocol/paceAPDUSender.ts +163 -0
- package/src/Shared/EIDReader/protocol/paceProtocol.ts +946 -0
- package/src/Shared/EIDReader/protocol/paceResult.ts +62 -0
- package/src/Shared/EIDReader/secureMessagingWrapper.ts +28 -10
- package/src/Shared/EIDReader/smartcards/commandAPDU.ts +2 -1
- package/src/Shared/EIDReader/tlv/tlv.helpers.ts +1 -1
- package/src/Shared/EIDReader/tlv/tlv.utils.ts +8 -5
- package/src/Shared/EIDReader/utils/aesCrypto.utils.ts +217 -0
- package/src/Shared/Libs/SignalingClient.ts +189 -0
- package/src/Shared/Libs/analytics.utils.ts +8 -0
- package/src/Shared/Libs/contains.ts +0 -53
- package/src/Shared/Libs/country-display.utils.ts +55 -0
- package/src/Shared/Libs/crypto.utils.ts +2 -2
- package/src/Shared/Libs/deeplink.utils.ts +12 -1
- package/src/Shared/Libs/demo.utils.ts +10 -0
- package/src/Shared/Libs/http-client.ts +19 -1
- package/src/Shared/Libs/mrz.utils.ts +3 -2
- package/src/Shared/Libs/promise.utils.ts +16 -2
- package/src/Shared/Libs/status-bar.utils.ts +21 -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 +4 -0
- package/src/Shared/Types/identificationInfo.ts +16 -1
- package/src/Translation/Resources/en.ts +88 -3
- package/src/Translation/Resources/tr.ts +89 -3
- package/src/Trustchex.tsx +65 -19
- package/src/version.ts +1 -1
|
@@ -6,35 +6,33 @@ import {
|
|
|
6
6
|
StyleSheet,
|
|
7
7
|
Platform,
|
|
8
8
|
Switch,
|
|
9
|
+
ActivityIndicator,
|
|
9
10
|
} from 'react-native';
|
|
10
11
|
import { useNavigation } from '@react-navigation/native';
|
|
11
12
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
13
|
+
import { useTranslation } from 'react-i18next';
|
|
12
14
|
import AppContext from '../Contexts/AppContext';
|
|
13
15
|
import { getSimulatedDemoData } from '../Libs/demo.utils';
|
|
14
16
|
import type { VerificationSession } from '../Types/verificationSession';
|
|
15
17
|
|
|
18
|
+
const DEV_BASE_URL = 'https://192.168.0.171:3000';
|
|
19
|
+
const DEBUG_VERBAL_CONSENT_TITLE_EN = 'Verbal Consent';
|
|
20
|
+
const DEBUG_VERBAL_CONSENT_TITLE_TR = 'Sözlü Onay';
|
|
21
|
+
const DEBUG_VERBAL_CONSENT_TEXT_EN =
|
|
22
|
+
'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.';
|
|
23
|
+
const DEBUG_VERBAL_CONSENT_TEXT_TR =
|
|
24
|
+
'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.';
|
|
25
|
+
|
|
16
26
|
type ScreenOption = {
|
|
17
27
|
screen: string;
|
|
18
28
|
label: string;
|
|
19
|
-
|
|
29
|
+
isDebug?: boolean;
|
|
20
30
|
hasOptions?: boolean;
|
|
21
31
|
hasDocumentTypeOption?: boolean;
|
|
22
32
|
setupDemo?: () => void;
|
|
23
33
|
params?: Record<string, unknown>;
|
|
24
34
|
};
|
|
25
35
|
|
|
26
|
-
// Icon mapping matching Flutter SDK Material Icons
|
|
27
|
-
const ICONS = {
|
|
28
|
-
LOGIN: '�', // Icons.login - Locked with key for session security
|
|
29
|
-
HANDSHAKE: '📝', // Icons.handshake - Document for contract signing
|
|
30
|
-
CREDIT_CARD: '🪪', // Icons.credit_card - ID card for document scan
|
|
31
|
-
NFC: '💳', // Icons.nfc - Contactless card for eID
|
|
32
|
-
FACE: '📸', // Icons.face - Camera for face detection
|
|
33
|
-
CHECK_CIRCLE: '📋', // Icons.check_circle - Clipboard for results
|
|
34
|
-
BUG_REPORT: '🔧', // Icons.bug_report - Wrench for debugging
|
|
35
|
-
PHONE: '💬', // Icons.phone - Message for OTP code
|
|
36
|
-
} as const;
|
|
37
|
-
|
|
38
36
|
const DebugNavigationPanel = () => {
|
|
39
37
|
const [isExpanded, setIsExpanded] = useState(false);
|
|
40
38
|
const [selectedScreen, setSelectedScreen] = useState<ScreenOption | null>(
|
|
@@ -43,9 +41,13 @@ const DebugNavigationPanel = () => {
|
|
|
43
41
|
const [voiceGuidanceEnabled, setVoiceGuidanceEnabled] = useState(true);
|
|
44
42
|
const [allowIdCard, setAllowIdCard] = useState(true);
|
|
45
43
|
const [allowPassport, setAllowPassport] = useState(true);
|
|
44
|
+
const [isConnectingVideoCall, setIsConnectingVideoCall] = useState(false);
|
|
45
|
+
const [videoCallError, setVideoCallError] = useState<string | null>(null);
|
|
46
46
|
const navigation = useNavigation();
|
|
47
47
|
const appContext = useContext(AppContext);
|
|
48
48
|
const insets = useSafeAreaInsets();
|
|
49
|
+
const { i18n } = useTranslation();
|
|
50
|
+
const isTurkish = (i18n.language || '').toLowerCase().startsWith('tr');
|
|
49
51
|
|
|
50
52
|
const setupDemoSession = useCallback(
|
|
51
53
|
(setDebugFlag: boolean = false) => {
|
|
@@ -108,12 +110,10 @@ const DebugNavigationPanel = () => {
|
|
|
108
110
|
{
|
|
109
111
|
screen: 'VerificationSessionCheckScreen',
|
|
110
112
|
label: 'Session Check',
|
|
111
|
-
icon: ICONS.LOGIN,
|
|
112
113
|
},
|
|
113
114
|
{
|
|
114
115
|
screen: 'OTPVerificationScreen',
|
|
115
116
|
label: 'OTP',
|
|
116
|
-
icon: ICONS.PHONE,
|
|
117
117
|
setupDemo: () => {
|
|
118
118
|
setupDemoSession(true);
|
|
119
119
|
},
|
|
@@ -122,7 +122,6 @@ const DebugNavigationPanel = () => {
|
|
|
122
122
|
{
|
|
123
123
|
screen: 'ContractAcceptanceScreen',
|
|
124
124
|
label: 'Consent',
|
|
125
|
-
icon: ICONS.HANDSHAKE,
|
|
126
125
|
hasOptions: true,
|
|
127
126
|
setupDemo: () => {
|
|
128
127
|
setupDemoSession(true);
|
|
@@ -135,10 +134,55 @@ const DebugNavigationPanel = () => {
|
|
|
135
134
|
}
|
|
136
135
|
},
|
|
137
136
|
},
|
|
137
|
+
{
|
|
138
|
+
screen: 'VerbalConsentScreen',
|
|
139
|
+
label: 'Verbal Consent',
|
|
140
|
+
hasOptions: true,
|
|
141
|
+
setupDemo: () => {
|
|
142
|
+
setupDemoSession(true);
|
|
143
|
+
const existingStep = appContext.workflowSteps?.find(
|
|
144
|
+
(s) => s.type === 'VERBAL_CONSENT'
|
|
145
|
+
);
|
|
146
|
+
|
|
147
|
+
const localizedConsentTitle = isTurkish
|
|
148
|
+
? DEBUG_VERBAL_CONSENT_TITLE_TR
|
|
149
|
+
: DEBUG_VERBAL_CONSENT_TITLE_EN;
|
|
150
|
+
const localizedConsentText = isTurkish
|
|
151
|
+
? DEBUG_VERBAL_CONSENT_TEXT_TR
|
|
152
|
+
: DEBUG_VERBAL_CONSENT_TEXT_EN;
|
|
153
|
+
|
|
154
|
+
const localizedStep = existingStep
|
|
155
|
+
? {
|
|
156
|
+
...existingStep,
|
|
157
|
+
data: {
|
|
158
|
+
...existingStep.data,
|
|
159
|
+
verbalConsentTitle: localizedConsentTitle,
|
|
160
|
+
verbalConsentText: localizedConsentText,
|
|
161
|
+
voiceGuidanceActive: false,
|
|
162
|
+
},
|
|
163
|
+
}
|
|
164
|
+
: {
|
|
165
|
+
type: 'VERBAL_CONSENT' as const,
|
|
166
|
+
required: true,
|
|
167
|
+
data: {
|
|
168
|
+
verbalConsentTitle: localizedConsentTitle,
|
|
169
|
+
verbalConsentText: localizedConsentText,
|
|
170
|
+
voiceGuidanceActive: false,
|
|
171
|
+
},
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
if (appContext.workflowSteps) {
|
|
175
|
+
appContext.workflowSteps = appContext.workflowSteps.map((step) =>
|
|
176
|
+
step.type === 'VERBAL_CONSENT' ? localizedStep : step
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
appContext.currentWorkflowStep = localizedStep;
|
|
181
|
+
},
|
|
182
|
+
},
|
|
138
183
|
{
|
|
139
184
|
screen: 'IdentityDocumentScanningScreen',
|
|
140
185
|
label: 'ID Scan',
|
|
141
|
-
icon: ICONS.CREDIT_CARD,
|
|
142
186
|
hasOptions: true,
|
|
143
187
|
hasDocumentTypeOption: true,
|
|
144
188
|
setupDemo: () => {
|
|
@@ -154,7 +198,6 @@ const DebugNavigationPanel = () => {
|
|
|
154
198
|
{
|
|
155
199
|
screen: 'IdentityDocumentEIDScanningScreen',
|
|
156
200
|
label: 'eID Scan',
|
|
157
|
-
icon: ICONS.NFC,
|
|
158
201
|
hasOptions: true,
|
|
159
202
|
hasDocumentTypeOption: true,
|
|
160
203
|
setupDemo: () => {
|
|
@@ -170,7 +213,6 @@ const DebugNavigationPanel = () => {
|
|
|
170
213
|
{
|
|
171
214
|
screen: 'LivenessDetectionScreen',
|
|
172
215
|
label: 'Liveness',
|
|
173
|
-
icon: ICONS.FACE,
|
|
174
216
|
hasOptions: true,
|
|
175
217
|
setupDemo: () => {
|
|
176
218
|
setupDemoSession(true);
|
|
@@ -185,7 +227,6 @@ const DebugNavigationPanel = () => {
|
|
|
185
227
|
{
|
|
186
228
|
screen: 'ResultScreen',
|
|
187
229
|
label: 'Result',
|
|
188
|
-
icon: ICONS.CHECK_CIRCLE,
|
|
189
230
|
setupDemo: () => {
|
|
190
231
|
setupDemoSession();
|
|
191
232
|
},
|
|
@@ -193,7 +234,17 @@ const DebugNavigationPanel = () => {
|
|
|
193
234
|
{
|
|
194
235
|
screen: 'MRZTestScreen',
|
|
195
236
|
label: 'MRZ Test',
|
|
196
|
-
|
|
237
|
+
isDebug: true,
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
screen: 'BarcodeTestScreen',
|
|
241
|
+
label: 'Barcode Test',
|
|
242
|
+
isDebug: true,
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
screen: 'NFCScanTestScreen',
|
|
246
|
+
label: 'NFC Scan Test',
|
|
247
|
+
isDebug: true,
|
|
197
248
|
},
|
|
198
249
|
];
|
|
199
250
|
|
|
@@ -202,6 +253,7 @@ const DebugNavigationPanel = () => {
|
|
|
202
253
|
if (!screen.hasOptions) {
|
|
203
254
|
if (screen.setupDemo) {
|
|
204
255
|
screen.setupDemo();
|
|
256
|
+
applyVoiceGuidance(voiceGuidanceEnabled);
|
|
205
257
|
}
|
|
206
258
|
(navigation as any).navigate(screen.screen, screen.params);
|
|
207
259
|
setIsExpanded(false);
|
|
@@ -212,12 +264,70 @@ const DebugNavigationPanel = () => {
|
|
|
212
264
|
setAllowIdCard(true);
|
|
213
265
|
setAllowPassport(true);
|
|
214
266
|
},
|
|
215
|
-
[navigation]
|
|
267
|
+
[navigation, voiceGuidanceEnabled, applyVoiceGuidance]
|
|
216
268
|
);
|
|
217
269
|
|
|
218
|
-
const
|
|
219
|
-
|
|
270
|
+
const handleVideoCallTest = useCallback(async () => {
|
|
271
|
+
setIsConnectingVideoCall(true);
|
|
272
|
+
setVideoCallError(null);
|
|
273
|
+
try {
|
|
274
|
+
const fallbackUrl = (appContext.baseUrl ?? '').replace(/\/$/, '');
|
|
275
|
+
let response: Response;
|
|
276
|
+
let usedBaseUrl = DEV_BASE_URL;
|
|
277
|
+
try {
|
|
278
|
+
response = await fetch(
|
|
279
|
+
`${DEV_BASE_URL}/api/test/video-sessions/latest`
|
|
280
|
+
);
|
|
281
|
+
} catch {
|
|
282
|
+
usedBaseUrl = fallbackUrl;
|
|
283
|
+
response = await fetch(`${fallbackUrl}/api/test/video-sessions/latest`);
|
|
284
|
+
}
|
|
285
|
+
const text = await response.text();
|
|
286
|
+
let data: any;
|
|
287
|
+
try {
|
|
288
|
+
data = JSON.parse(text);
|
|
289
|
+
} catch {
|
|
290
|
+
throw new Error(
|
|
291
|
+
`Server returned non-JSON (${response.status}): ${text.slice(0, 120)}`
|
|
292
|
+
);
|
|
293
|
+
}
|
|
294
|
+
if (!response.ok || !data.success) {
|
|
295
|
+
throw new Error(data.message || 'No active test session found');
|
|
296
|
+
}
|
|
297
|
+
// Point SDK at the server where the test session lives.
|
|
298
|
+
// Do NOT call setBaseUrl (state setter) — it triggers a useMemo rebuild in
|
|
299
|
+
// Trustchex.tsx that resets identificationInfo to an empty object before the
|
|
300
|
+
// screen can render. Direct mutation is sufficient for the test flow.
|
|
301
|
+
appContext.baseUrl = usedBaseUrl;
|
|
302
|
+
appContext.isTestVideoSession = true;
|
|
303
|
+
appContext.identificationInfo.identificationId = data.identificationId;
|
|
304
|
+
appContext.identificationInfo.videoSessionId = data.videoSessionId;
|
|
305
|
+
appContext.identificationInfo.sessionId = data.verificationSessionId;
|
|
306
|
+
|
|
307
|
+
// Set up a mini workflow: eID scan → video call
|
|
308
|
+
const eidStep = {
|
|
309
|
+
type: 'IDENTITY_DOCUMENT_EID_SCAN' as const,
|
|
310
|
+
required: false,
|
|
311
|
+
data: { voiceGuidanceActive: false },
|
|
312
|
+
};
|
|
313
|
+
const videoCallStep = {
|
|
314
|
+
type: 'VIDEO_CALL' as const,
|
|
315
|
+
required: true,
|
|
316
|
+
data: {},
|
|
317
|
+
};
|
|
318
|
+
appContext.workflowSteps = [eidStep, videoCallStep];
|
|
319
|
+
appContext.currentWorkflowStep = eidStep;
|
|
220
320
|
|
|
321
|
+
(navigation as any).navigate('IdentityDocumentEIDScanningScreen');
|
|
322
|
+
setIsExpanded(false);
|
|
323
|
+
} catch (err: any) {
|
|
324
|
+
setVideoCallError(err.message || 'Failed to connect');
|
|
325
|
+
} finally {
|
|
326
|
+
setIsConnectingVideoCall(false);
|
|
327
|
+
}
|
|
328
|
+
}, [appContext, navigation]);
|
|
329
|
+
|
|
330
|
+
const jumpToScreen = useCallback(() => {
|
|
221
331
|
// Validate document type selection for document scanning screens
|
|
222
332
|
if (
|
|
223
333
|
selectedScreen.hasDocumentTypeOption &&
|
|
@@ -265,11 +375,9 @@ const DebugNavigationPanel = () => {
|
|
|
265
375
|
<Text style={styles.title}>SDK JUMP TO SCREEN:</Text>
|
|
266
376
|
{selectedScreen ? (
|
|
267
377
|
<View>
|
|
268
|
-
<Text style={styles.optionsTitle}>
|
|
269
|
-
{selectedScreen.icon} {selectedScreen.label}
|
|
270
|
-
</Text>
|
|
378
|
+
<Text style={styles.optionsTitle}>{selectedScreen.label}</Text>
|
|
271
379
|
<View style={styles.optionRow}>
|
|
272
|
-
<Text style={styles.optionLabel}
|
|
380
|
+
<Text style={styles.optionLabel}>Voice Guidance</Text>
|
|
273
381
|
<Switch
|
|
274
382
|
value={voiceGuidanceEnabled}
|
|
275
383
|
onValueChange={setVoiceGuidanceEnabled}
|
|
@@ -280,7 +388,7 @@ const DebugNavigationPanel = () => {
|
|
|
280
388
|
{selectedScreen.hasDocumentTypeOption && (
|
|
281
389
|
<>
|
|
282
390
|
<View style={styles.optionRow}>
|
|
283
|
-
<Text style={styles.optionLabel}
|
|
391
|
+
<Text style={styles.optionLabel}>Allow ID Card</Text>
|
|
284
392
|
<Switch
|
|
285
393
|
value={allowIdCard}
|
|
286
394
|
onValueChange={setAllowIdCard}
|
|
@@ -289,7 +397,7 @@ const DebugNavigationPanel = () => {
|
|
|
289
397
|
/>
|
|
290
398
|
</View>
|
|
291
399
|
<View style={styles.optionRow}>
|
|
292
|
-
<Text style={styles.optionLabel}
|
|
400
|
+
<Text style={styles.optionLabel}>Allow Passport</Text>
|
|
293
401
|
<Switch
|
|
294
402
|
value={allowPassport}
|
|
295
403
|
onValueChange={setAllowPassport}
|
|
@@ -336,16 +444,53 @@ const DebugNavigationPanel = () => {
|
|
|
336
444
|
</View>
|
|
337
445
|
</View>
|
|
338
446
|
) : (
|
|
339
|
-
|
|
447
|
+
<>
|
|
448
|
+
{screens
|
|
449
|
+
.filter((s) => !s.isDebug)
|
|
450
|
+
.map((screen) => (
|
|
451
|
+
<TouchableOpacity
|
|
452
|
+
key={screen.screen}
|
|
453
|
+
style={styles.screenButton}
|
|
454
|
+
onPress={() => selectScreen(screen)}
|
|
455
|
+
>
|
|
456
|
+
<Text style={styles.screenLabel}>{screen.label}</Text>
|
|
457
|
+
</TouchableOpacity>
|
|
458
|
+
))}
|
|
459
|
+
<View style={styles.sectionDivider}>
|
|
460
|
+
<View style={styles.sectionDividerLine} />
|
|
461
|
+
<Text style={styles.sectionDividerLabel}>DEBUG TOOLS</Text>
|
|
462
|
+
<View style={styles.sectionDividerLine} />
|
|
463
|
+
</View>
|
|
464
|
+
{screens
|
|
465
|
+
.filter((s) => s.isDebug)
|
|
466
|
+
.map((screen) => (
|
|
467
|
+
<TouchableOpacity
|
|
468
|
+
key={screen.screen}
|
|
469
|
+
style={styles.debugScreenButton}
|
|
470
|
+
onPress={() => selectScreen(screen)}
|
|
471
|
+
>
|
|
472
|
+
<Text style={styles.debugScreenLabel}>{screen.label}</Text>
|
|
473
|
+
</TouchableOpacity>
|
|
474
|
+
))}
|
|
340
475
|
<TouchableOpacity
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
476
|
+
style={[
|
|
477
|
+
styles.videoCallTestButton,
|
|
478
|
+
isConnectingVideoCall && styles.videoCallTestButtonDisabled,
|
|
479
|
+
]}
|
|
480
|
+
onPress={handleVideoCallTest}
|
|
481
|
+
disabled={isConnectingVideoCall}
|
|
344
482
|
>
|
|
345
|
-
|
|
346
|
-
|
|
483
|
+
{isConnectingVideoCall && (
|
|
484
|
+
<ActivityIndicator size="small" color="#4CAF50" />
|
|
485
|
+
)}
|
|
486
|
+
<Text style={styles.videoCallTestLabel}>
|
|
487
|
+
{isConnectingVideoCall ? 'Connecting...' : 'Video Call Test'}
|
|
488
|
+
</Text>
|
|
347
489
|
</TouchableOpacity>
|
|
348
|
-
|
|
490
|
+
{videoCallError && (
|
|
491
|
+
<Text style={styles.videoCallTestError}>{videoCallError}</Text>
|
|
492
|
+
)}
|
|
493
|
+
</>
|
|
349
494
|
)}
|
|
350
495
|
</View>
|
|
351
496
|
)}
|
|
@@ -359,14 +504,12 @@ const DebugNavigationPanel = () => {
|
|
|
359
504
|
setAllowPassport(true);
|
|
360
505
|
}}
|
|
361
506
|
>
|
|
362
|
-
<Text style={styles.bugIcon}>{ICONS.BUG_REPORT}</Text>
|
|
363
507
|
{isExpanded && (
|
|
364
508
|
<>
|
|
365
|
-
<View style={styles.spacing} />
|
|
366
509
|
<Text style={styles.toggleText}>DEBUG NAV</Text>
|
|
510
|
+
<View style={styles.spacing} />
|
|
367
511
|
</>
|
|
368
512
|
)}
|
|
369
|
-
<View style={styles.spacing} />
|
|
370
513
|
<Text style={styles.arrow}>{isExpanded ? '▼' : '▲'}</Text>
|
|
371
514
|
</TouchableOpacity>
|
|
372
515
|
</View>
|
|
@@ -384,9 +527,9 @@ const styles = StyleSheet.create({
|
|
|
384
527
|
flexDirection: 'row',
|
|
385
528
|
alignItems: 'center',
|
|
386
529
|
backgroundColor: '#FF5252',
|
|
387
|
-
paddingHorizontal:
|
|
530
|
+
paddingHorizontal: 10,
|
|
388
531
|
paddingVertical: 10,
|
|
389
|
-
borderRadius:
|
|
532
|
+
borderRadius: 8,
|
|
390
533
|
borderWidth: 2,
|
|
391
534
|
borderColor: 'white',
|
|
392
535
|
...Platform.select({
|
|
@@ -401,9 +544,6 @@ const styles = StyleSheet.create({
|
|
|
401
544
|
},
|
|
402
545
|
}),
|
|
403
546
|
},
|
|
404
|
-
bugIcon: {
|
|
405
|
-
fontSize: 24,
|
|
406
|
-
},
|
|
407
547
|
spacing: {
|
|
408
548
|
width: 8,
|
|
409
549
|
},
|
|
@@ -415,6 +555,9 @@ const styles = StyleSheet.create({
|
|
|
415
555
|
arrow: {
|
|
416
556
|
color: 'white',
|
|
417
557
|
fontSize: 20,
|
|
558
|
+
lineHeight: 20,
|
|
559
|
+
textAlignVertical: 'center',
|
|
560
|
+
includeFontPadding: false,
|
|
418
561
|
},
|
|
419
562
|
panel: {
|
|
420
563
|
backgroundColor: 'rgba(0, 0, 0, 0.9)',
|
|
@@ -454,12 +597,6 @@ const styles = StyleSheet.create({
|
|
|
454
597
|
borderRadius: 4,
|
|
455
598
|
marginBottom: 6,
|
|
456
599
|
},
|
|
457
|
-
screenIcon: {
|
|
458
|
-
fontSize: 16,
|
|
459
|
-
marginRight: 8,
|
|
460
|
-
width: 20,
|
|
461
|
-
textAlign: 'center',
|
|
462
|
-
},
|
|
463
600
|
screenLabel: {
|
|
464
601
|
color: 'white',
|
|
465
602
|
fontSize: 12,
|
|
@@ -518,6 +655,70 @@ const styles = StyleSheet.create({
|
|
|
518
655
|
goButtonTextDisabled: {
|
|
519
656
|
color: '#CCCCCC',
|
|
520
657
|
},
|
|
658
|
+
sectionDivider: {
|
|
659
|
+
flexDirection: 'row',
|
|
660
|
+
alignItems: 'center',
|
|
661
|
+
marginTop: 4,
|
|
662
|
+
marginBottom: 6,
|
|
663
|
+
gap: 6,
|
|
664
|
+
},
|
|
665
|
+
sectionDividerLine: {
|
|
666
|
+
flex: 1,
|
|
667
|
+
height: 1,
|
|
668
|
+
backgroundColor: 'rgba(255, 167, 38, 0.4)',
|
|
669
|
+
},
|
|
670
|
+
sectionDividerLabel: {
|
|
671
|
+
color: '#FFA726',
|
|
672
|
+
fontSize: 9,
|
|
673
|
+
fontWeight: 'bold',
|
|
674
|
+
letterSpacing: 1,
|
|
675
|
+
},
|
|
676
|
+
debugScreenButton: {
|
|
677
|
+
flexDirection: 'row',
|
|
678
|
+
alignItems: 'center',
|
|
679
|
+
justifyContent: 'flex-start',
|
|
680
|
+
backgroundColor: 'rgba(255, 167, 38, 0.15)',
|
|
681
|
+
borderWidth: 1,
|
|
682
|
+
borderColor: 'rgba(255, 167, 38, 0.4)',
|
|
683
|
+
paddingHorizontal: 12,
|
|
684
|
+
paddingVertical: 8,
|
|
685
|
+
borderRadius: 4,
|
|
686
|
+
marginBottom: 6,
|
|
687
|
+
},
|
|
688
|
+
debugScreenLabel: {
|
|
689
|
+
color: '#FFA726',
|
|
690
|
+
fontSize: 12,
|
|
691
|
+
fontWeight: '500',
|
|
692
|
+
flex: 1,
|
|
693
|
+
},
|
|
694
|
+
videoCallTestButton: {
|
|
695
|
+
flexDirection: 'row',
|
|
696
|
+
alignItems: 'center',
|
|
697
|
+
justifyContent: 'flex-start',
|
|
698
|
+
backgroundColor: 'rgba(76, 175, 80, 0.15)',
|
|
699
|
+
borderWidth: 1,
|
|
700
|
+
borderColor: 'rgba(76, 175, 80, 0.5)',
|
|
701
|
+
paddingHorizontal: 12,
|
|
702
|
+
paddingVertical: 8,
|
|
703
|
+
borderRadius: 4,
|
|
704
|
+
marginBottom: 6,
|
|
705
|
+
gap: 8,
|
|
706
|
+
},
|
|
707
|
+
videoCallTestButtonDisabled: {
|
|
708
|
+
opacity: 0.5,
|
|
709
|
+
},
|
|
710
|
+
videoCallTestLabel: {
|
|
711
|
+
color: '#4CAF50',
|
|
712
|
+
fontSize: 12,
|
|
713
|
+
fontWeight: '600',
|
|
714
|
+
flex: 1,
|
|
715
|
+
},
|
|
716
|
+
videoCallTestError: {
|
|
717
|
+
color: '#FF5252',
|
|
718
|
+
fontSize: 10,
|
|
719
|
+
marginBottom: 6,
|
|
720
|
+
paddingHorizontal: 4,
|
|
721
|
+
},
|
|
521
722
|
});
|
|
522
723
|
|
|
523
724
|
export default DebugNavigationPanel;
|