@trustchex/react-native-sdk 1.478.7 → 1.481.1
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 +57 -3
- package/ios/Camera/TrustchexCameraView.swift +20 -15
- package/lib/module/Screens/Static/ResultScreen.js +42 -6
- package/lib/module/Shared/Components/DiagnosticReportButton.js +64 -0
- package/lib/module/Shared/Components/IdentityDocumentCamera.js +132 -8
- package/lib/module/Shared/Components/NavigationManager.js +7 -9
- package/lib/module/Shared/EIDReader/eidReader.js +149 -29
- package/lib/module/Shared/Libs/MRZ_KNOWN_ISSUES.md +7 -0
- package/lib/module/Shared/Libs/diagnosticReport.js +133 -0
- package/lib/module/Shared/Libs/diagnostics.js +171 -0
- package/lib/module/Shared/Libs/mrzFrameAggregator.js +32 -5
- package/lib/module/Shared/Libs/native-device-info.utils.js +67 -0
- package/lib/module/Shared/Libs/sendDiagnosticReport.js +130 -0
- package/lib/module/Translation/Resources/en.js +5 -0
- package/lib/module/Translation/Resources/tr.js +5 -0
- package/lib/module/Trustchex.js +20 -4
- package/lib/module/version.js +1 -1
- package/lib/typescript/src/Screens/Static/ResultScreen.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Components/DiagnosticReportButton.d.ts +20 -0
- package/lib/typescript/src/Shared/Components/DiagnosticReportButton.d.ts.map +1 -0
- package/lib/typescript/src/Shared/Components/IdentityDocumentCamera.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Components/IdentityDocumentCamera.types.d.ts +10 -0
- package/lib/typescript/src/Shared/Components/IdentityDocumentCamera.types.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Components/NavigationManager.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Components/TrustchexCamera.d.ts +10 -0
- package/lib/typescript/src/Shared/Components/TrustchexCamera.d.ts.map +1 -1
- package/lib/typescript/src/Shared/EIDReader/eidReader.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Libs/diagnosticReport.d.ts +48 -0
- package/lib/typescript/src/Shared/Libs/diagnosticReport.d.ts.map +1 -0
- package/lib/typescript/src/Shared/Libs/diagnostics.d.ts +145 -0
- package/lib/typescript/src/Shared/Libs/diagnostics.d.ts.map +1 -0
- package/lib/typescript/src/Shared/Libs/mrzFrameAggregator.d.ts +33 -0
- package/lib/typescript/src/Shared/Libs/mrzFrameAggregator.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Libs/native-device-info.utils.d.ts +33 -0
- package/lib/typescript/src/Shared/Libs/native-device-info.utils.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Libs/sendDiagnosticReport.d.ts +30 -0
- package/lib/typescript/src/Shared/Libs/sendDiagnosticReport.d.ts.map +1 -0
- package/lib/typescript/src/Translation/Resources/en.d.ts +5 -0
- package/lib/typescript/src/Translation/Resources/en.d.ts.map +1 -1
- package/lib/typescript/src/Translation/Resources/tr.d.ts +5 -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 +5 -1
- package/src/Screens/Static/ResultScreen.tsx +46 -1
- package/src/Shared/Components/DiagnosticReportButton.tsx +77 -0
- package/src/Shared/Components/IdentityDocumentCamera.tsx +145 -7
- package/src/Shared/Components/IdentityDocumentCamera.types.ts +6 -0
- package/src/Shared/Components/NavigationManager.tsx +7 -7
- package/src/Shared/Components/TrustchexCamera.tsx +6 -0
- package/src/Shared/EIDReader/eidReader.ts +166 -46
- package/src/Shared/Libs/MRZ_KNOWN_ISSUES.md +7 -0
- package/src/Shared/Libs/diagnosticReport.ts +206 -0
- package/src/Shared/Libs/diagnostics.ts +251 -0
- package/src/Shared/Libs/mrzFrameAggregator.ts +61 -3
- package/src/Shared/Libs/native-device-info.utils.ts +116 -0
- package/src/Shared/Libs/sendDiagnosticReport.ts +165 -0
- package/src/Translation/Resources/en.ts +6 -0
- package/src/Translation/Resources/tr.ts +6 -0
- package/src/Trustchex.tsx +26 -3
- package/src/version.ts +1 -1
package/src/Trustchex.tsx
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, {
|
|
2
|
+
useEffect,
|
|
3
|
+
useState,
|
|
4
|
+
useMemo,
|
|
5
|
+
useRef,
|
|
6
|
+
useCallback,
|
|
7
|
+
} from 'react';
|
|
2
8
|
import { NavigationContainer } from '@react-navigation/native';
|
|
3
9
|
import { createNativeStackNavigator } from '@react-navigation/native-stack';
|
|
4
10
|
import { View, ActivityIndicator, StyleSheet } from 'react-native';
|
|
@@ -96,11 +102,27 @@ const Trustchex: React.FC<TrustchexProps> = ({
|
|
|
96
102
|
// discarding those mutations and causing screens to see undefined values.
|
|
97
103
|
const contextRef = useRef<AppContextType | null>(null);
|
|
98
104
|
|
|
105
|
+
// Wrap the demo-session setter so it ALSO mutates the persistent context
|
|
106
|
+
// object synchronously. The React state update is async, but the verification
|
|
107
|
+
// flow navigates to the next step in the same tick and advances thereafter by
|
|
108
|
+
// direct mutation (never re-rendering Trustchex). If isDemoSession lived only
|
|
109
|
+
// as a state-derived memo field, downstream screens (e.g. ResultScreen, which
|
|
110
|
+
// gates the diagnostics button on it) could read a stale `false`. Mutating the
|
|
111
|
+
// ref makes the flag travel with the object every screen holds.
|
|
112
|
+
const setIsDemoSessionAndPersist = useCallback((value: boolean) => {
|
|
113
|
+
if (contextRef.current) {
|
|
114
|
+
contextRef.current.isDemoSession = value;
|
|
115
|
+
}
|
|
116
|
+
setIsDemoSession(value);
|
|
117
|
+
}, []);
|
|
118
|
+
|
|
99
119
|
const contextValue = useMemo(() => {
|
|
100
120
|
const prev = contextRef.current;
|
|
101
121
|
|
|
102
122
|
const value: AppContextType = {
|
|
103
|
-
|
|
123
|
+
// Prefer a direct mutation carried on the persistent object over the
|
|
124
|
+
// (possibly not-yet-flushed) state, so the demo flag can't desync.
|
|
125
|
+
isDemoSession: prev?.isDemoSession || isDemoSession,
|
|
104
126
|
baseUrl: baseUrl || '',
|
|
105
127
|
locale,
|
|
106
128
|
branding,
|
|
@@ -124,7 +146,7 @@ const Trustchex: React.FC<TrustchexProps> = ({
|
|
|
124
146
|
onError,
|
|
125
147
|
setSessionId,
|
|
126
148
|
setBaseUrl,
|
|
127
|
-
setIsDemoSession,
|
|
149
|
+
setIsDemoSession: setIsDemoSessionAndPersist,
|
|
128
150
|
};
|
|
129
151
|
|
|
130
152
|
// Update state-derived identificationInfo fields without replacing
|
|
@@ -146,6 +168,7 @@ const Trustchex: React.FC<TrustchexProps> = ({
|
|
|
146
168
|
onCompleted,
|
|
147
169
|
onError,
|
|
148
170
|
isDemoSession,
|
|
171
|
+
setIsDemoSessionAndPersist,
|
|
149
172
|
]);
|
|
150
173
|
|
|
151
174
|
// Initialize analytics when SDK mounts with valid session
|
package/src/version.ts
CHANGED