@trustchex/react-native-sdk 1.497.0 → 1.500.2

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 (35) hide show
  1. package/lib/module/Screens/Static/ResultScreen.js +104 -11
  2. package/lib/module/Shared/Components/EIDScanner.js +28 -3
  3. package/lib/module/Shared/Components/ErrorBoundary.js +144 -0
  4. package/lib/module/Shared/Components/IdentityDocumentCamera.constants.js +5 -0
  5. package/lib/module/Shared/Components/IdentityDocumentCamera.js +163 -4
  6. package/lib/module/Shared/Libs/mrz.utils.js +24 -1
  7. package/lib/module/Translation/Resources/en.js +13 -0
  8. package/lib/module/Translation/Resources/tr.js +13 -0
  9. package/lib/module/Trustchex.js +52 -49
  10. package/lib/module/version.js +1 -1
  11. package/lib/typescript/src/Screens/Static/ResultScreen.d.ts.map +1 -1
  12. package/lib/typescript/src/Shared/Components/EIDScanner.d.ts.map +1 -1
  13. package/lib/typescript/src/Shared/Components/ErrorBoundary.d.ts +17 -0
  14. package/lib/typescript/src/Shared/Components/ErrorBoundary.d.ts.map +1 -0
  15. package/lib/typescript/src/Shared/Components/IdentityDocumentCamera.constants.d.ts +1 -0
  16. package/lib/typescript/src/Shared/Components/IdentityDocumentCamera.constants.d.ts.map +1 -1
  17. package/lib/typescript/src/Shared/Components/IdentityDocumentCamera.d.ts.map +1 -1
  18. package/lib/typescript/src/Shared/Libs/mrz.utils.d.ts.map +1 -1
  19. package/lib/typescript/src/Translation/Resources/en.d.ts +13 -0
  20. package/lib/typescript/src/Translation/Resources/en.d.ts.map +1 -1
  21. package/lib/typescript/src/Translation/Resources/tr.d.ts +13 -0
  22. package/lib/typescript/src/Translation/Resources/tr.d.ts.map +1 -1
  23. package/lib/typescript/src/Trustchex.d.ts.map +1 -1
  24. package/lib/typescript/src/version.d.ts +1 -1
  25. package/package.json +1 -1
  26. package/src/Screens/Static/ResultScreen.tsx +145 -29
  27. package/src/Shared/Components/EIDScanner.tsx +38 -0
  28. package/src/Shared/Components/ErrorBoundary.tsx +151 -0
  29. package/src/Shared/Components/IdentityDocumentCamera.constants.ts +5 -0
  30. package/src/Shared/Components/IdentityDocumentCamera.tsx +220 -27
  31. package/src/Shared/Libs/mrz.utils.ts +27 -1
  32. package/src/Translation/Resources/en.ts +16 -0
  33. package/src/Translation/Resources/tr.ts +16 -0
  34. package/src/Trustchex.tsx +64 -59
  35. package/src/version.ts +1 -1
@@ -11,6 +11,7 @@ import {
11
11
  ActivityIndicator,
12
12
  PermissionsAndroid,
13
13
  Animated,
14
+ TouchableOpacity,
14
15
  type NativeSyntheticEvent,
15
16
  type ViewStyle,
16
17
  } from 'react-native';
@@ -31,6 +32,7 @@ import { debugLog, logError, isDebugEnabled } from '../Libs/debug.utils';
31
32
  import { diagnostics } from '../Libs/diagnostics';
32
33
  import LottieView from 'lottie-react-native';
33
34
  import StyledButton from './StyledButton';
35
+ import DiagnosticReportButton from './DiagnosticReportButton';
34
36
  import { SafeAreaView } from 'react-native-safe-area-context';
35
37
  import { speak, resetLastMessage } from '../Libs/tts.utils';
36
38
  import AppContext from '../Contexts/AppContext';
@@ -67,6 +69,7 @@ import {
67
69
  MAX_CONSECUTIVE_QUALITY_FAILURES,
68
70
  REQUIRED_CONSISTENT_MRZ_READS,
69
71
  REQUIRED_CONSISTENT_DOCTYPE_DETECTIONS,
72
+ HELP_PROMPT_DELAY_MS,
70
73
  SIGNATURE_TEXT_REGEX,
71
74
  MRZ_BLOCK_PATTERN,
72
75
  MIN_CARD_FACE_SIZE_PERCENT,
@@ -143,6 +146,13 @@ const IdentityDocumentCamera = ({
143
146
  // cleared when a frame passes the brightness check (a fresh, glare-free frame).
144
147
  const [isGlareDetected, setIsGlareDetected] = useState(false);
145
148
  const [hasGuideShown, setHasGuideShown] = useState(false);
149
+ // "Having trouble?" escape: if a scan step doesn't complete within
150
+ // HELP_PROMPT_DELAY_MS the user is otherwise stuck on a live camera forever
151
+ // (no timeout/retry/help). We surface an unobtrusive prompt, then an opt-in
152
+ // help sheet with tips / retry / torch.
153
+ const [showHelpPrompt, setShowHelpPrompt] = useState(false);
154
+ const [helpSheetVisible, setHelpSheetVisible] = useState(false);
155
+ const stepStartedAt = useRef<number>(Date.now());
146
156
  const [status, setStatus] = useState<
147
157
  'SEARCHING' | 'SCANNING' | 'SCANNED' | 'INCORRECT'
148
158
  >('SEARCHING');
@@ -444,6 +454,25 @@ const IdentityDocumentCamera = ({
444
454
  }
445
455
  }, [status]);
446
456
 
457
+ // "Having trouble?" stuck-detection. The scan is frame-driven with no
458
+ // wall-clock timeout, so a document that never reads leaves the user stranded.
459
+ // Re-arm per step (keyed on nextStep) and per scan-start (hasGuideShown); show
460
+ // the prompt once the current step has been open longer than the threshold.
461
+ // Never arm on the terminal COMPLETED step.
462
+ useEffect(() => {
463
+ setShowHelpPrompt(false);
464
+ stepStartedAt.current = Date.now();
465
+ if (!hasGuideShown || nextStep === 'COMPLETED') {
466
+ return;
467
+ }
468
+ const interval = setInterval(() => {
469
+ if (Date.now() - stepStartedAt.current >= HELP_PROMPT_DELAY_MS) {
470
+ setShowHelpPrompt(true);
471
+ }
472
+ }, 1000);
473
+ return () => clearInterval(interval);
474
+ }, [nextStep, hasGuideShown]);
475
+
447
476
  // Disable face detection when scanning back side (no face expected, avoids false positives)
448
477
  useEffect(() => {
449
478
  if (nextStep === 'SCAN_ID_BACK') {
@@ -2643,37 +2672,53 @@ const IdentityDocumentCamera = ({
2643
2672
  onCameraError={handleCameraError}
2644
2673
  />
2645
2674
  <View style={[styles.topZone, { paddingTop: insets.top }]}>
2646
- {nextStep !== 'COMPLETED' &&
2647
- status !== 'SCANNED' &&
2648
- detectedDocumentType !== 'UNKNOWN' && (
2649
- <TextView style={styles.stepIndicator}>
2650
- {nextStep === 'SCAN_ID_FRONT_OR_PASSPORT'
2651
- ? `${t('identityDocumentCamera.frontSide')} • ${t(
2675
+ {nextStep !== 'COMPLETED' && status !== 'SCANNED' && (
2676
+ <TextView style={styles.stepIndicator}>
2677
+ {nextStep === 'SCAN_ID_FRONT_OR_PASSPORT'
2678
+ ? // Show "Front side • 1/N" from the START — even before the
2679
+ // document type is recognized — so the user immediately knows
2680
+ // to present the photo side and how many steps remain. Until
2681
+ // the type is known we assume the ID-card path (the common
2682
+ // case); the total corrects to the passport count once a
2683
+ // passport is detected.
2684
+ `${t('identityDocumentCamera.frontSide')} • ${t(
2685
+ 'identityDocumentCamera.stepProgress',
2686
+ {
2687
+ current: 1,
2688
+ total: onlyMRZScan
2689
+ ? detectedDocumentType === 'PASSPORT'
2690
+ ? 1
2691
+ : 2
2692
+ : detectedDocumentType === 'PASSPORT'
2693
+ ? 2
2694
+ : 3,
2695
+ }
2696
+ )}`
2697
+ : nextStep === 'SCAN_HOLOGRAM'
2698
+ ? `${t('identityDocumentCamera.hologramCheck')} • ${t(
2652
2699
  'identityDocumentCamera.stepProgress',
2653
2700
  {
2654
- current: 1,
2655
- total: onlyMRZScan
2656
- ? detectedDocumentType === 'PASSPORT'
2657
- ? 1
2658
- : 2
2659
- : detectedDocumentType === 'PASSPORT'
2660
- ? 2
2661
- : 3,
2701
+ current: 2,
2702
+ total: detectedDocumentType === 'PASSPORT' ? 2 : 3,
2662
2703
  }
2663
2704
  )}`
2664
- : nextStep === 'SCAN_HOLOGRAM'
2665
- ? `${t('identityDocumentCamera.hologramCheck')} • ${t(
2666
- 'identityDocumentCamera.stepProgress',
2667
- {
2668
- current: 2,
2669
- total: detectedDocumentType === 'PASSPORT' ? 2 : 3,
2670
- }
2671
- )}`
2672
- : nextStep === 'SCAN_ID_BACK'
2673
- ? `${t('identityDocumentCamera.backSide')} ${t('identityDocumentCamera.stepProgress', { current: 3, total: 3 })}`
2674
- : ''}
2675
- </TextView>
2676
- )}
2705
+ : nextStep === 'SCAN_ID_BACK'
2706
+ ? `${t('identityDocumentCamera.backSide')} • ${t('identityDocumentCamera.stepProgress', { current: 3, total: 3 })}`
2707
+ : ''}
2708
+ </TextView>
2709
+ )}
2710
+
2711
+ {/* Hologram capture progress — 16 frames are collected while the user
2712
+ tilts the document; show N/16 so "tilt slowly" feels responsive
2713
+ instead of a silent wait. */}
2714
+ {nextStep === 'SCAN_HOLOGRAM' && status !== 'SCANNED' && (
2715
+ <TextView style={styles.hologramProgress}>
2716
+ {t('identityDocumentCamera.hologramProgress', {
2717
+ current: hologramImageCount,
2718
+ total: HOLOGRAM_IMAGE_COUNT,
2719
+ })}
2720
+ </TextView>
2721
+ )}
2677
2722
 
2678
2723
  <AnimatedText
2679
2724
  style={[
@@ -2788,6 +2833,97 @@ const IdentityDocumentCamera = ({
2788
2833
  {testMode && testModeData && (
2789
2834
  <TestModePanel mrzText={testModeData.mrzText} />
2790
2835
  )}
2836
+
2837
+ {/* "Having trouble?" prompt — shows after the step has been stuck a
2838
+ while; tapping it opens the help sheet. */}
2839
+ {showHelpPrompt && !helpSheetVisible && nextStep !== 'COMPLETED' && (
2840
+ <TouchableOpacity
2841
+ style={styles.helpPrompt}
2842
+ accessibilityRole="button"
2843
+ onPress={() => setHelpSheetVisible(true)}
2844
+ >
2845
+ <TextView style={styles.helpPromptText}>
2846
+ {t('identityDocumentCamera.havingTrouble')}
2847
+ </TextView>
2848
+ </TouchableOpacity>
2849
+ )}
2850
+
2851
+ {/* Plain absolute overlay (NOT a <Modal>): the help sheet hosts a
2852
+ DiagnosticReportButton which renders its OWN <Modal> for the sending
2853
+ overlay, and nesting Modals is unreliable on iOS (the inner sending/
2854
+ cancel UI can fail to present). An absolute View avoids the nesting. */}
2855
+ {helpSheetVisible && (
2856
+ <View style={styles.helpBackdrop}>
2857
+ <View style={styles.helpCard}>
2858
+ <TextView style={styles.helpTitle}>
2859
+ {t('identityDocumentCamera.troubleTitle')}
2860
+ </TextView>
2861
+ <TextView style={styles.helpTip}>
2862
+ {`• ${t('identityDocumentCamera.guidePoint1')}`}
2863
+ </TextView>
2864
+ <TextView style={styles.helpTip}>
2865
+ {`• ${t('identityDocumentCamera.guidePoint2')}`}
2866
+ </TextView>
2867
+ <TextView style={styles.helpTip}>
2868
+ {`• ${t('identityDocumentCamera.guidePoint3')}`}
2869
+ </TextView>
2870
+
2871
+ {/* Torch is most useful in low light — only offer it then, and
2872
+ not during the hologram step (which manages the torch itself). */}
2873
+ {isBrightnessLow && nextStep !== 'SCAN_HOLOGRAM' && (
2874
+ <StyledButton
2875
+ mode="outlined"
2876
+ onPress={() => {
2877
+ setIsTorchOn(!isTorchOnRef.current);
2878
+ }}
2879
+ style={styles.helpButton}
2880
+ >
2881
+ {isTorchOn
2882
+ ? t('identityDocumentCamera.turnOffTorch')
2883
+ : t('identityDocumentCamera.turnOnTorch')}
2884
+ </StyledButton>
2885
+ )}
2886
+
2887
+ <StyledButton
2888
+ mode="contained"
2889
+ onPress={() => {
2890
+ // Full restart: send the flow back to the first step (so a
2891
+ // stuck back/hologram step truly restarts, matching the label)
2892
+ // and re-show the guide, which deactivates + resets scan state
2893
+ // via the focus effect.
2894
+ setHelpSheetVisible(false);
2895
+ setShowHelpPrompt(false);
2896
+ setNextStep('SCAN_ID_FRONT_OR_PASSPORT');
2897
+ setDetectedDocumentType('UNKNOWN');
2898
+ setHasGuideShown(false);
2899
+ }}
2900
+ style={styles.helpButton}
2901
+ >
2902
+ {t('identityDocumentCamera.troubleRetry')}
2903
+ </StyledButton>
2904
+
2905
+ {/* Support channel for a stuck scan. The diagnostics singleton
2906
+ has captured this scan's camera signals (brightness, blur,
2907
+ glare, frame stats); the report is PoW-authenticated and opt-in
2908
+ (asks before sending), and auto-hides without baseUrl/session. */}
2909
+ <View style={styles.helpButton}>
2910
+ <DiagnosticReportButton
2911
+ baseUrl={appContext.baseUrl}
2912
+ sessionId={appContext.identificationInfo?.sessionId}
2913
+ scan={{ documentType: detectedDocumentType }}
2914
+ />
2915
+ </View>
2916
+
2917
+ <StyledButton
2918
+ mode="text"
2919
+ onPress={() => setHelpSheetVisible(false)}
2920
+ style={styles.helpButton}
2921
+ >
2922
+ {t('identityDocumentCamera.troubleDismiss')}
2923
+ </StyledButton>
2924
+ </View>
2925
+ </View>
2926
+ )}
2791
2927
  </>
2792
2928
  </View>
2793
2929
  );
@@ -2842,6 +2978,13 @@ const styles = StyleSheet.create({
2842
2978
  fontWeight: '500',
2843
2979
  marginBottom: 4,
2844
2980
  },
2981
+ hologramProgress: {
2982
+ color: '#4CAF50',
2983
+ fontSize: 14,
2984
+ textAlign: 'center',
2985
+ fontWeight: '600',
2986
+ marginBottom: 4,
2987
+ },
2845
2988
  topZoneText: {
2846
2989
  color: 'white',
2847
2990
  fontSize: 20,
@@ -2877,6 +3020,56 @@ const styles = StyleSheet.create({
2877
3020
  bottom: '36%',
2878
3021
  backgroundColor: '#00000099',
2879
3022
  },
3023
+ helpPrompt: {
3024
+ position: 'absolute',
3025
+ bottom: 40,
3026
+ alignSelf: 'center',
3027
+ backgroundColor: 'rgba(0,0,0,0.65)',
3028
+ paddingVertical: 10,
3029
+ paddingHorizontal: 20,
3030
+ borderRadius: 22,
3031
+ },
3032
+ helpPromptText: {
3033
+ color: 'white',
3034
+ fontSize: 15,
3035
+ fontWeight: '600',
3036
+ },
3037
+ helpBackdrop: {
3038
+ position: 'absolute',
3039
+ top: 0,
3040
+ left: 0,
3041
+ right: 0,
3042
+ bottom: 0,
3043
+ backgroundColor: 'rgba(0,0,0,0.55)',
3044
+ alignItems: 'center',
3045
+ justifyContent: 'center',
3046
+ padding: 24,
3047
+ zIndex: 10,
3048
+ },
3049
+ helpCard: {
3050
+ width: '100%',
3051
+ maxWidth: 340,
3052
+ backgroundColor: 'white',
3053
+ borderRadius: 16,
3054
+ paddingVertical: 24,
3055
+ paddingHorizontal: 20,
3056
+ },
3057
+ helpTitle: {
3058
+ fontSize: 18,
3059
+ fontWeight: 'bold',
3060
+ color: '#111827',
3061
+ textAlign: 'center',
3062
+ marginBottom: 16,
3063
+ },
3064
+ helpTip: {
3065
+ fontSize: 15,
3066
+ color: '#374151',
3067
+ lineHeight: 22,
3068
+ marginBottom: 8,
3069
+ },
3070
+ helpButton: {
3071
+ marginTop: 12,
3072
+ },
2880
3073
  bottomZone: {
2881
3074
  position: 'absolute',
2882
3075
  top: '64%',
@@ -428,7 +428,33 @@ const reconstructMRZCandidates = (rawText: string): string[][] => {
428
428
  head = fixed + head.slice(9);
429
429
  }
430
430
  }
431
- const optional = '<'.repeat(14);
431
+
432
+ // Recover the REAL optional/personal-number field (line-2 positions
433
+ // 29–42, i.e. 0-indexed 28–41) instead of blanking it. Many passports
434
+ // (and most residence permits) carry a personal number here; blanking it
435
+ // silently drops that data. Stitch any split fragment lines onto this
436
+ // line so the optional window is present, then accept the OCR'd optional
437
+ // ONLY if its own check digit (position 43, 0-indexed 42) validates —
438
+ // that proves the 14 chars were read correctly. If it doesn't validate
439
+ // (garbled/split-filler), fall back to the canonical blank, preserving
440
+ // the previous robustness for the empty-optional case.
441
+ let stitched = ocrLines[i];
442
+ let sj = i + 1;
443
+ while (stitched.length < 44 && sj < ocrLines.length) {
444
+ stitched += ocrLines[sj];
445
+ sj++;
446
+ }
447
+ let optional = '<'.repeat(14);
448
+ if (stitched.length >= 43) {
449
+ const candidateOptional = stitched.slice(28, 42);
450
+ const optionalCheck = stitched[42];
451
+ if (
452
+ /^[A-Z0-9<]{14}$/.test(candidateOptional) &&
453
+ cd731(candidateOptional) === optionalCheck
454
+ ) {
455
+ optional = candidateOptional;
456
+ }
457
+ }
432
458
  const l2NoComposite = head + optional + cd731(optional);
433
459
  const composite =
434
460
  l2NoComposite.slice(0, 10) +
@@ -33,6 +33,14 @@ export default {
33
33
  'termsOfUseAndDataPrivacyScreen.acceptAndContinue': 'Accept and Continue',
34
34
  'resultScreen.submitting': 'Submitting your information...',
35
35
  'resultScreen.submissionFailed': 'An error occurred. Please try again later.',
36
+ 'resultScreen.submissionFailedTitle': 'Submission failed',
37
+ 'resultScreen.submissionFailedRetryHint':
38
+ 'We could not submit your verification. Your information is saved — you can try again without re-scanning.',
39
+ 'resultScreen.retrySubmission': 'Retry',
40
+ 'errorBoundary.title': 'Something went wrong',
41
+ 'errorBoundary.message':
42
+ 'An unexpected error occurred. You can try again to continue.',
43
+ 'errorBoundary.tryAgain': 'Try Again',
36
44
  'resultScreen.submissionSuccessful':
37
45
  'Your information has been securely submitted. You will be notified of the verification result shortly.',
38
46
  'resultScreen.thankYou': 'Thank You!',
@@ -160,6 +168,12 @@ export default {
160
168
  'Place document on a flat, dark surface',
161
169
  'identityDocumentCamera.guidePoint2': 'Use adequate lighting without glare',
162
170
  'identityDocumentCamera.guidePoint3': 'Keep the document within the frame',
171
+ 'identityDocumentCamera.havingTrouble': 'Having trouble?',
172
+ 'identityDocumentCamera.troubleTitle': 'Tips for scanning',
173
+ 'identityDocumentCamera.troubleRetry': 'Restart scan',
174
+ 'identityDocumentCamera.troubleDismiss': 'Keep trying',
175
+ 'identityDocumentCamera.turnOnTorch': 'Turn on flashlight',
176
+ 'identityDocumentCamera.turnOffTorch': 'Turn off flashlight',
163
177
  'identityDocumentCamera.lowBrightness':
164
178
  'Insufficient lighting. Move to a brighter location.',
165
179
  'identityDocumentCamera.alignPhotoSide': 'Show the side with your photo',
@@ -179,6 +193,8 @@ export default {
179
193
  'identityDocumentCamera.frontSide': 'Front',
180
194
  'identityDocumentCamera.backSide': 'Back',
181
195
  'identityDocumentCamera.hologramCheck': 'Hologram',
196
+ 'identityDocumentCamera.hologramProgress':
197
+ 'Capturing hologram… {{current}}/{{total}}',
182
198
  'identityDocumentCamera.keepSteady': 'Keep device steady',
183
199
  'identityDocumentCamera.avoidBlur': 'Keep device steady',
184
200
  'identityDocumentCamera.reduceGlare':
@@ -33,6 +33,14 @@ export default {
33
33
  'resultScreen.submitting': 'Bilgileriniz gönderiliyor...',
34
34
  'resultScreen.submissionFailed':
35
35
  'Bir hata oluştu. Lütfen daha sonra tekrar deneyin.',
36
+ 'resultScreen.submissionFailedTitle': 'Gönderim başarısız',
37
+ 'resultScreen.submissionFailedRetryHint':
38
+ 'Doğrulamanız gönderilemedi. Bilgileriniz kaydedildi — yeniden taramadan tekrar deneyebilirsiniz.',
39
+ 'resultScreen.retrySubmission': 'Tekrar Dene',
40
+ 'errorBoundary.title': 'Bir şeyler ters gitti',
41
+ 'errorBoundary.message':
42
+ 'Beklenmeyen bir hata oluştu. Devam etmek için tekrar deneyebilirsiniz.',
43
+ 'errorBoundary.tryAgain': 'Tekrar Dene',
36
44
  'resultScreen.submissionSuccessful':
37
45
  'Bilgileriniz güvenle gönderilmiştir. Doğrulama sonucu kısa süre içinde size bildirilecektir.',
38
46
  'resultScreen.thankYou': 'Teşekkürler!',
@@ -161,6 +169,12 @@ export default {
161
169
  'Belgeyi düz, koyu bir zemin üzerine yerleştirin',
162
170
  'identityDocumentCamera.guidePoint2': 'Yansıma olmadan yeterli ışık kullanın',
163
171
  'identityDocumentCamera.guidePoint3': 'Belgeyi çerçeve içinde tutun',
172
+ 'identityDocumentCamera.havingTrouble': 'Sorun mu yaşıyorsunuz?',
173
+ 'identityDocumentCamera.troubleTitle': 'Tarama ipuçları',
174
+ 'identityDocumentCamera.troubleRetry': 'Taramayı yeniden başlat',
175
+ 'identityDocumentCamera.troubleDismiss': 'Denemeye devam et',
176
+ 'identityDocumentCamera.turnOnTorch': 'Feneri aç',
177
+ 'identityDocumentCamera.turnOffTorch': 'Feneri kapat',
164
178
  'identityDocumentCamera.lowBrightness':
165
179
  'Aydınlatma yetersiz. Lütfen daha aydınlık bir yere gidin.',
166
180
  'identityDocumentCamera.alignPhotoSide': 'Fotoğraflı yüzü gösterin',
@@ -180,6 +194,8 @@ export default {
180
194
  'identityDocumentCamera.frontSide': 'Ön',
181
195
  'identityDocumentCamera.backSide': 'Arka',
182
196
  'identityDocumentCamera.hologramCheck': 'Hologram',
197
+ 'identityDocumentCamera.hologramProgress':
198
+ 'Hologram yakalanıyor… {{current}}/{{total}}',
183
199
  'identityDocumentCamera.keepSteady': 'Cihazı sabit tutun',
184
200
  'identityDocumentCamera.avoidBlur': 'Cihazı sabit tutun',
185
201
  'identityDocumentCamera.reduceGlare':
package/src/Trustchex.tsx CHANGED
@@ -30,6 +30,7 @@ import NFCScanTestScreen from './Screens/Debug/NFCScanTestScreen';
30
30
  import AppContext, { type AppContextType } from './Shared/Contexts/AppContext';
31
31
  import type { DocumentReadResult } from './Shared/Types/documentReadResult';
32
32
  import DebugNavigationPanel from './Shared/Components/DebugNavigationPanel';
33
+ import ErrorBoundary from './Shared/Components/ErrorBoundary';
33
34
  import i18n from './Translation';
34
35
  import { initializeTTS } from './Shared/Libs/tts.utils';
35
36
  import { analyticsService } from './Shared/Services/AnalyticsService';
@@ -102,7 +103,9 @@ const Trustchex: React.FC<TrustchexProps> = ({
102
103
  const [isInitialized, setIsInitialized] = useState(false);
103
104
  const [analyticsInitialized, setAnalyticsInitialized] = useState(false);
104
105
  const [isDemoSession, setIsDemoSession] = useState(false);
105
- const [lastDocumentRead, setLastDocumentReadState] = useState<DocumentReadResult | undefined>(undefined);
106
+ const [lastDocumentRead, setLastDocumentReadState] = useState<
107
+ DocumentReadResult | undefined
108
+ >(undefined);
106
109
 
107
110
  const branding = useMemo(
108
111
  () => ({
@@ -278,64 +281,66 @@ const Trustchex: React.FC<TrustchexProps> = ({
278
281
  tertiaryColor={branding.tertiaryColor}
279
282
  >
280
283
  <AppContext.Provider value={contextValue}>
281
- <NavigationContainer>
282
- <Stack.Navigator
283
- id={undefined}
284
- initialRouteName="VerificationSessionCheckScreen"
285
- screenOptions={{
286
- headerShown: false,
287
- headerBackButtonMenuEnabled: false,
288
- }}
289
- >
290
- <Stack.Screen
291
- name="VerificationSessionCheckScreen"
292
- component={VerificationSessionCheckScreen}
293
- />
294
- <Stack.Screen
295
- name="OTPVerificationScreen"
296
- component={OTPVerificationScreen}
297
- />
298
- <Stack.Screen
299
- name="ContractAcceptanceScreen"
300
- component={ContractAcceptanceScreen}
301
- />
302
- <Stack.Screen
303
- name="IdentityDocumentScanningScreen"
304
- component={IdentityDocumentScanningScreen}
305
- />
306
- <Stack.Screen
307
- name="IdentityDocumentEIDScanningScreen"
308
- component={IdentityDocumentEIDScanningScreen}
309
- />
310
- <Stack.Screen
311
- name="LivenessDetectionScreen"
312
- component={LivenessDetectionScreen}
313
- />
314
- <Stack.Screen name="ResultScreen" component={ResultScreen} />
315
- <Stack.Screen
316
- name="QrCodeScanningScreen"
317
- component={QrCodeScanningScreen}
318
- />
319
- <Stack.Screen
320
- name="VideoCallScreen"
321
- component={VideoCallScreen}
322
- />
323
- <Stack.Screen
324
- name="VerbalConsentScreen"
325
- component={VerbalConsentScreen}
326
- />
327
- <Stack.Screen name="MRZTestScreen" component={MRZTestScreen} />
328
- <Stack.Screen
329
- name="BarcodeTestScreen"
330
- component={BarcodeTestScreen}
331
- />
332
- <Stack.Screen
333
- name="NFCScanTestScreen"
334
- component={NFCScanTestScreen}
335
- />
336
- </Stack.Navigator>
337
- <DebugNavigationPanel />
338
- </NavigationContainer>
284
+ <ErrorBoundary>
285
+ <NavigationContainer>
286
+ <Stack.Navigator
287
+ id={undefined}
288
+ initialRouteName="VerificationSessionCheckScreen"
289
+ screenOptions={{
290
+ headerShown: false,
291
+ headerBackButtonMenuEnabled: false,
292
+ }}
293
+ >
294
+ <Stack.Screen
295
+ name="VerificationSessionCheckScreen"
296
+ component={VerificationSessionCheckScreen}
297
+ />
298
+ <Stack.Screen
299
+ name="OTPVerificationScreen"
300
+ component={OTPVerificationScreen}
301
+ />
302
+ <Stack.Screen
303
+ name="ContractAcceptanceScreen"
304
+ component={ContractAcceptanceScreen}
305
+ />
306
+ <Stack.Screen
307
+ name="IdentityDocumentScanningScreen"
308
+ component={IdentityDocumentScanningScreen}
309
+ />
310
+ <Stack.Screen
311
+ name="IdentityDocumentEIDScanningScreen"
312
+ component={IdentityDocumentEIDScanningScreen}
313
+ />
314
+ <Stack.Screen
315
+ name="LivenessDetectionScreen"
316
+ component={LivenessDetectionScreen}
317
+ />
318
+ <Stack.Screen name="ResultScreen" component={ResultScreen} />
319
+ <Stack.Screen
320
+ name="QrCodeScanningScreen"
321
+ component={QrCodeScanningScreen}
322
+ />
323
+ <Stack.Screen
324
+ name="VideoCallScreen"
325
+ component={VideoCallScreen}
326
+ />
327
+ <Stack.Screen
328
+ name="VerbalConsentScreen"
329
+ component={VerbalConsentScreen}
330
+ />
331
+ <Stack.Screen name="MRZTestScreen" component={MRZTestScreen} />
332
+ <Stack.Screen
333
+ name="BarcodeTestScreen"
334
+ component={BarcodeTestScreen}
335
+ />
336
+ <Stack.Screen
337
+ name="NFCScanTestScreen"
338
+ component={NFCScanTestScreen}
339
+ />
340
+ </Stack.Navigator>
341
+ <DebugNavigationPanel />
342
+ </NavigationContainer>
343
+ </ErrorBoundary>
339
344
  </AppContext.Provider>
340
345
  </ThemeProvider>
341
346
  </SafeAreaProvider>
package/src/version.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  // This file is auto-generated. Do not edit manually.
2
2
  // Version is synced from package.json during build.
3
- export const SDK_VERSION = '1.497.0';
3
+ export const SDK_VERSION = '1.500.2';