@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identificationInfo.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/Types/identificationInfo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAExE,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE;QACP,WAAW,EAAE,MAAM,EAAE,CAAC;QACtB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,eAAe,CAAC,EAAE,uBAAuB,CAAC;IAC1C,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,MAAM,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"identificationInfo.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/Types/identificationInfo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAExE,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE;QACP,WAAW,EAAE,MAAM,EAAE,CAAC;QACtB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,eAAe,CAAC,EAAE,uBAAuB,CAAC;IAC1C,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,4BAA4B,CAAC,EAAE,OAAO,CAAC;IACvC,mBAAmB,CAAC,EAAE,kBAAkB,EAAE,CAAC;CAC5C;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,uBAAuB;IACtC,YAAY,EAAE,IAAI,GAAG,UAAU,GAAG,SAAS,CAAC;IAC5C,UAAU,EAAE,SAAS,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;IAC9C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAED,MAAM,WAAW,iBAAiB;IAChC,YAAY,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACvD,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,EACA,qBAAqB,GACrB,wBAAwB,GACxB,4BAA4B,GAC5B,gBAAgB,GAChB,gBAAgB,GAChB,WAAW,GACX,YAAY,CAAC;IACjB,IAAI,CAAC,EAAE;QACL,SAAS,CAAC,EAAE;YACV,EAAE,EAAE;gBACF,EAAE,EAAE,MAAM,CAAC;gBACX,IAAI,EAAE,MAAM,CAAC;gBACb,GAAG,EAAE,MAAM,CAAC;aACb,CAAC;YACF,EAAE,EAAE;gBACF,EAAE,EAAE,MAAM,CAAC;gBACX,IAAI,EAAE,MAAM,CAAC;gBACb,GAAG,EAAE,MAAM,CAAC;aACb,CAAC;SACH,CAAC;QACF,oBAAoB,CAAC,EAAE,CAAC,GAAG,GAAG,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC;QAC5C,gBAAgB,CAAC,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;QAClC,+BAA+B,CAAC,EAAE,uBAAuB,EAAE,GAAG,IAAI,CAAC;QACnE,mBAAmB,CAAC,EAAE,OAAO,CAAC;QAC9B,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACnC,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KACnC,CAAC;IACF,QAAQ,EAAE,OAAO,CAAC;CACnB"}
|
|
@@ -39,6 +39,9 @@ declare const _default: {
|
|
|
39
39
|
'resultScreen.demoImageHologram': string;
|
|
40
40
|
'resultScreen.demoLivenessDetection': string;
|
|
41
41
|
'resultScreen.demoVideo': string;
|
|
42
|
+
'resultScreen.demoVerbalConsent': string;
|
|
43
|
+
'resultScreen.demoVerbalConsentTitle': string;
|
|
44
|
+
'resultScreen.demoVerbalConsentText': string;
|
|
42
45
|
'resultScreen.demoStartOver': string;
|
|
43
46
|
'livenessDetectionScreen.guideHeader': string;
|
|
44
47
|
'livenessDetectionScreen.guideText': string;
|
|
@@ -62,7 +65,6 @@ declare const _default: {
|
|
|
62
65
|
'eidScannerScreen.guideHeader': string;
|
|
63
66
|
'eidScannerScreen.guideText': string;
|
|
64
67
|
'eidScannerScreen.invalidMRZFields': string;
|
|
65
|
-
'eidScannerScreen.imageCannotBeShown': string;
|
|
66
68
|
'eidScannerScreen.faceImageNotFound': string;
|
|
67
69
|
'eidScannerScreen.documentCode': string;
|
|
68
70
|
'eidScannerScreen.nationality': string;
|
|
@@ -72,6 +74,13 @@ declare const _default: {
|
|
|
72
74
|
'eidScannerScreen.surname': string;
|
|
73
75
|
'eidScannerScreen.birthDate': string;
|
|
74
76
|
'eidScannerScreen.gender': string;
|
|
77
|
+
'eidScannerScreen.genderMale': string;
|
|
78
|
+
'eidScannerScreen.genderFemale': string;
|
|
79
|
+
'eidScannerScreen.genderUnspecified': string;
|
|
80
|
+
'eidScannerScreen.docTypePassport': string;
|
|
81
|
+
'eidScannerScreen.docTypeID': string;
|
|
82
|
+
'eidScannerScreen.docTypeResidence': string;
|
|
83
|
+
'eidScannerScreen.docTypeVisa': string;
|
|
75
84
|
'eidScannerScreen.expirationDate': string;
|
|
76
85
|
'eidScannerScreen.mrzText': string;
|
|
77
86
|
'eidScannerScreen.nfcNotSupported': string;
|
|
@@ -125,6 +134,56 @@ declare const _default: {
|
|
|
125
134
|
'identityDocumentCamera.documentTooLarge': string;
|
|
126
135
|
'identityDocumentCamera.holdSteady': string;
|
|
127
136
|
'identityDocumentCamera.centerDocument': string;
|
|
137
|
+
'videoCallScreen.guideHeader': string;
|
|
138
|
+
'videoCallScreen.guideText': string;
|
|
139
|
+
'videoCallScreen.guidePoint1': string;
|
|
140
|
+
'videoCallScreen.guidePoint2': string;
|
|
141
|
+
'videoCallScreen.guidePoint3': string;
|
|
142
|
+
'videoCallScreen.guidePoint4': string;
|
|
143
|
+
'videoCallScreen.waitingForAgent': string;
|
|
144
|
+
'videoCallScreen.queuePosition': string;
|
|
145
|
+
'videoCallScreen.new': string;
|
|
146
|
+
'videoCallScreen.connecting': string;
|
|
147
|
+
'videoCallScreen.connected': string;
|
|
148
|
+
'videoCallScreen.disconnected': string;
|
|
149
|
+
'videoCallScreen.failed': string;
|
|
150
|
+
'videoCallScreen.closed': string;
|
|
151
|
+
'videoCallScreen.permissions_denied': string;
|
|
152
|
+
'videoCallScreen.leaveQueue': string;
|
|
153
|
+
'videoCallScreen.closeSession': string;
|
|
154
|
+
'videoCallScreen.closeSessionHint': string;
|
|
155
|
+
'videoCallScreen.agentInstructions': string;
|
|
156
|
+
'videoCallScreen.callNotCompleted': string;
|
|
157
|
+
'verbalConsentVideoScreen.title': string;
|
|
158
|
+
'verbalConsentVideoScreen.description': string;
|
|
159
|
+
'verbalConsentVideoScreen.guideHeader': string;
|
|
160
|
+
'verbalConsentVideoScreen.guideText': string;
|
|
161
|
+
'verbalConsentVideoScreen.guidePoint1': string;
|
|
162
|
+
'verbalConsentVideoScreen.guidePoint2': string;
|
|
163
|
+
'verbalConsentVideoScreen.guidePoint3': string;
|
|
164
|
+
'verbalConsentVideoScreen.guidePoint4': string;
|
|
165
|
+
'verbalConsentVideoScreen.defaultConsentText': string;
|
|
166
|
+
'verbalConsentVideoScreen.startRecording': string;
|
|
167
|
+
'verbalConsentVideoScreen.stopRecording': string;
|
|
168
|
+
'verbalConsentVideoScreen.recordAgain': string;
|
|
169
|
+
'verbalConsentVideoScreen.tryAgain': string;
|
|
170
|
+
'verbalConsentVideoScreen.submit': string;
|
|
171
|
+
'verbalConsentVideoScreen.recordingProgress': string;
|
|
172
|
+
'verbalConsentVideoScreen.readNowPrompt': string;
|
|
173
|
+
'verbalConsentVideoScreen.scrollReadStopHint': string;
|
|
174
|
+
'verbalConsentVideoScreen.scrollCompletedStopHint': string;
|
|
175
|
+
'verbalConsentVideoScreen.recordingIndicator': string;
|
|
176
|
+
'verbalConsentVideoScreen.recordingStartedBanner': string;
|
|
177
|
+
'verbalConsentVideoScreen.keepHeadInCirclePrompt': string;
|
|
178
|
+
'verbalConsentVideoScreen.readThenStopPrompt': string;
|
|
179
|
+
'verbalConsentVideoScreen.readProgress': string;
|
|
180
|
+
'verbalConsentVideoScreen.stopHintPending': string;
|
|
181
|
+
'verbalConsentVideoScreen.stopHintReady': string;
|
|
182
|
+
'verbalConsentVideoScreen.faceAligned': string;
|
|
183
|
+
'verbalConsentVideoScreen.previewTitle': string;
|
|
184
|
+
'verbalConsentVideoScreen.analytics.recordingFailed': string;
|
|
185
|
+
'verbalConsentVideoScreen.analytics.identificationIdMissing': string;
|
|
186
|
+
'verbalConsentVideoScreen.analytics.uploadFailed': string;
|
|
128
187
|
'navigationManager.skipStepWarning': string;
|
|
129
188
|
'navigationManager.skipStepLabel': string;
|
|
130
189
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../../../src/Translation/Resources/en.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../../../src/Translation/Resources/en.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wBAwPE"}
|
|
@@ -39,6 +39,9 @@ declare const _default: {
|
|
|
39
39
|
'resultScreen.demoImageHologram': string;
|
|
40
40
|
'resultScreen.demoLivenessDetection': string;
|
|
41
41
|
'resultScreen.demoVideo': string;
|
|
42
|
+
'resultScreen.demoVerbalConsent': string;
|
|
43
|
+
'resultScreen.demoVerbalConsentTitle': string;
|
|
44
|
+
'resultScreen.demoVerbalConsentText': string;
|
|
42
45
|
'resultScreen.demoStartOver': string;
|
|
43
46
|
'livenessDetectionScreen.guideHeader': string;
|
|
44
47
|
'livenessDetectionScreen.guideText': string;
|
|
@@ -62,7 +65,6 @@ declare const _default: {
|
|
|
62
65
|
'eidScannerScreen.guideHeader': string;
|
|
63
66
|
'eidScannerScreen.guideText': string;
|
|
64
67
|
'eidScannerScreen.invalidMRZFields': string;
|
|
65
|
-
'eidScannerScreen.imageCannotBeShown': string;
|
|
66
68
|
'eidScannerScreen.faceImageNotFound': string;
|
|
67
69
|
'eidScannerScreen.documentCode': string;
|
|
68
70
|
'eidScannerScreen.nationality': string;
|
|
@@ -72,6 +74,13 @@ declare const _default: {
|
|
|
72
74
|
'eidScannerScreen.surname': string;
|
|
73
75
|
'eidScannerScreen.birthDate': string;
|
|
74
76
|
'eidScannerScreen.gender': string;
|
|
77
|
+
'eidScannerScreen.genderMale': string;
|
|
78
|
+
'eidScannerScreen.genderFemale': string;
|
|
79
|
+
'eidScannerScreen.genderUnspecified': string;
|
|
80
|
+
'eidScannerScreen.docTypePassport': string;
|
|
81
|
+
'eidScannerScreen.docTypeID': string;
|
|
82
|
+
'eidScannerScreen.docTypeResidence': string;
|
|
83
|
+
'eidScannerScreen.docTypeVisa': string;
|
|
75
84
|
'eidScannerScreen.expirationDate': string;
|
|
76
85
|
'eidScannerScreen.mrzText': string;
|
|
77
86
|
'eidScannerScreen.nfcNotSupported': string;
|
|
@@ -125,6 +134,56 @@ declare const _default: {
|
|
|
125
134
|
'identityDocumentCamera.documentTooLarge': string;
|
|
126
135
|
'identityDocumentCamera.holdSteady': string;
|
|
127
136
|
'identityDocumentCamera.centerDocument': string;
|
|
137
|
+
'videoCallScreen.guideHeader': string;
|
|
138
|
+
'videoCallScreen.guideText': string;
|
|
139
|
+
'videoCallScreen.guidePoint1': string;
|
|
140
|
+
'videoCallScreen.guidePoint2': string;
|
|
141
|
+
'videoCallScreen.guidePoint3': string;
|
|
142
|
+
'videoCallScreen.guidePoint4': string;
|
|
143
|
+
'videoCallScreen.waitingForAgent': string;
|
|
144
|
+
'videoCallScreen.queuePosition': string;
|
|
145
|
+
'videoCallScreen.new': string;
|
|
146
|
+
'videoCallScreen.connecting': string;
|
|
147
|
+
'videoCallScreen.connected': string;
|
|
148
|
+
'videoCallScreen.disconnected': string;
|
|
149
|
+
'videoCallScreen.failed': string;
|
|
150
|
+
'videoCallScreen.closed': string;
|
|
151
|
+
'videoCallScreen.permissions_denied': string;
|
|
152
|
+
'videoCallScreen.leaveQueue': string;
|
|
153
|
+
'videoCallScreen.closeSession': string;
|
|
154
|
+
'videoCallScreen.closeSessionHint': string;
|
|
155
|
+
'videoCallScreen.agentInstructions': string;
|
|
156
|
+
'videoCallScreen.callNotCompleted': string;
|
|
157
|
+
'verbalConsentVideoScreen.title': string;
|
|
158
|
+
'verbalConsentVideoScreen.description': string;
|
|
159
|
+
'verbalConsentVideoScreen.guideHeader': string;
|
|
160
|
+
'verbalConsentVideoScreen.guideText': string;
|
|
161
|
+
'verbalConsentVideoScreen.guidePoint1': string;
|
|
162
|
+
'verbalConsentVideoScreen.guidePoint2': string;
|
|
163
|
+
'verbalConsentVideoScreen.guidePoint3': string;
|
|
164
|
+
'verbalConsentVideoScreen.guidePoint4': string;
|
|
165
|
+
'verbalConsentVideoScreen.defaultConsentText': string;
|
|
166
|
+
'verbalConsentVideoScreen.startRecording': string;
|
|
167
|
+
'verbalConsentVideoScreen.stopRecording': string;
|
|
168
|
+
'verbalConsentVideoScreen.recordAgain': string;
|
|
169
|
+
'verbalConsentVideoScreen.tryAgain': string;
|
|
170
|
+
'verbalConsentVideoScreen.submit': string;
|
|
171
|
+
'verbalConsentVideoScreen.recordingProgress': string;
|
|
172
|
+
'verbalConsentVideoScreen.readNowPrompt': string;
|
|
173
|
+
'verbalConsentVideoScreen.scrollReadStopHint': string;
|
|
174
|
+
'verbalConsentVideoScreen.scrollCompletedStopHint': string;
|
|
175
|
+
'verbalConsentVideoScreen.recordingIndicator': string;
|
|
176
|
+
'verbalConsentVideoScreen.recordingStartedBanner': string;
|
|
177
|
+
'verbalConsentVideoScreen.keepHeadInCirclePrompt': string;
|
|
178
|
+
'verbalConsentVideoScreen.readThenStopPrompt': string;
|
|
179
|
+
'verbalConsentVideoScreen.readProgress': string;
|
|
180
|
+
'verbalConsentVideoScreen.stopHintPending': string;
|
|
181
|
+
'verbalConsentVideoScreen.stopHintReady': string;
|
|
182
|
+
'verbalConsentVideoScreen.faceAligned': string;
|
|
183
|
+
'verbalConsentVideoScreen.previewTitle': string;
|
|
184
|
+
'verbalConsentVideoScreen.analytics.recordingFailed': string;
|
|
185
|
+
'verbalConsentVideoScreen.analytics.identificationIdMissing': string;
|
|
186
|
+
'verbalConsentVideoScreen.analytics.uploadFailed': string;
|
|
128
187
|
'navigationManager.skipStepWarning': string;
|
|
129
188
|
'navigationManager.skipStepLabel': string;
|
|
130
189
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tr.d.ts","sourceRoot":"","sources":["../../../../../src/Translation/Resources/tr.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tr.d.ts","sourceRoot":"","sources":["../../../../../src/Translation/Resources/tr.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wBA2PE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Trustchex.d.ts","sourceRoot":"","sources":["../../../src/Trustchex.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Trustchex.d.ts","sourceRoot":"","sources":["../../../src/Trustchex.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+C,MAAM,OAAO,CAAC;AAKpE,OAAO,gCAAgC,CAAC;AAgCxC,UAAU,iBAAiB;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,UAAU,cAAc;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,MAAM,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;CACrE;AASD,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAgOvC,CAAC;AAWF,eAAe,SAAS,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.
|
|
1
|
+
export declare const SDK_VERSION = "1.464.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trustchex/react-native-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.464.0",
|
|
4
4
|
"description": "Trustchex mobile app react native SDK for android or ios devices",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|
|
@@ -56,6 +56,12 @@
|
|
|
56
56
|
"example",
|
|
57
57
|
"example-expo"
|
|
58
58
|
],
|
|
59
|
+
"resolutions": {
|
|
60
|
+
"@react-navigation/core": "7.12.4",
|
|
61
|
+
"@react-navigation/native": "7.1.18",
|
|
62
|
+
"@react-navigation/native-stack": "7.3.27",
|
|
63
|
+
"@react-navigation/elements": "2.6.5"
|
|
64
|
+
},
|
|
59
65
|
"scripts": {
|
|
60
66
|
"example": "yarn workspace @trustchex/react-native-sdk-example",
|
|
61
67
|
"example:android": "yarn example android",
|
|
@@ -78,12 +84,13 @@
|
|
|
78
84
|
"@eslint/compat": "^1.2.7",
|
|
79
85
|
"@eslint/eslintrc": "^3.3.0",
|
|
80
86
|
"@eslint/js": "^9.22.0",
|
|
81
|
-
"@react-native-community/cli": "
|
|
82
|
-
"@react-native/babel-preset": "0.79.
|
|
87
|
+
"@react-native-community/cli": "18.0.0",
|
|
88
|
+
"@react-native/babel-preset": "0.79.7",
|
|
83
89
|
"@react-native/eslint-config": "^0.78.0",
|
|
84
90
|
"@react-navigation/native": "^7.1.16",
|
|
85
91
|
"@react-navigation/native-stack": "^7.3.23",
|
|
86
92
|
"@release-it/conventional-changelog": "^9.0.2",
|
|
93
|
+
"@types/elliptic": "^6.4.18",
|
|
87
94
|
"@types/jest": "^29.5.5",
|
|
88
95
|
"@types/react": "^19.0.0",
|
|
89
96
|
"commitlint": "^19.6.1",
|
|
@@ -95,18 +102,22 @@
|
|
|
95
102
|
"lottie-react-native": "^7.2.4",
|
|
96
103
|
"prettier": "^3.0.3",
|
|
97
104
|
"react": "19.0.0",
|
|
98
|
-
"react-native": "0.79.
|
|
105
|
+
"react-native": "0.79.7",
|
|
99
106
|
"react-native-builder-bob": "^0.40.13",
|
|
100
107
|
"react-native-compressor": "^1.12.0",
|
|
101
108
|
"react-native-device-info": "^13.0.0",
|
|
102
109
|
"react-native-fs": "^2.20.0",
|
|
103
110
|
"react-native-get-random-values": "^1.11.0",
|
|
111
|
+
"react-native-incall-manager": "^4.2.0",
|
|
104
112
|
"react-native-nfc-manager": "^3.16.2",
|
|
105
113
|
"react-native-safe-area-context": "^5.5.2",
|
|
106
114
|
"react-native-screens": "^4.18.0",
|
|
115
|
+
"react-native-sse": "^1.1.0",
|
|
107
116
|
"react-native-svg": "^15.12.0",
|
|
108
117
|
"react-native-tts": "^4.1.1",
|
|
109
118
|
"react-native-video": "^6.16.1",
|
|
119
|
+
"react-native-vision-camera": "^4.7.1",
|
|
120
|
+
"react-native-webrtc": "^124.0.0",
|
|
110
121
|
"react-native-webview": "^13.15.0",
|
|
111
122
|
"release-it": "^17.10.0",
|
|
112
123
|
"turbo": "^1.10.7",
|
|
@@ -117,7 +128,9 @@
|
|
|
117
128
|
"@noble/curves": "^1.9.4",
|
|
118
129
|
"buffer": "^6.0.3",
|
|
119
130
|
"crypto-js": "^4.2.0",
|
|
131
|
+
"elliptic": "^6.6.1",
|
|
120
132
|
"i18next": "^25.3.2",
|
|
133
|
+
"jpeg2000": "^1.1.1",
|
|
121
134
|
"mrz": "^5.0.1",
|
|
122
135
|
"react-i18next": "^15.6.0",
|
|
123
136
|
"uuid": "^11.0.3"
|
|
@@ -132,13 +145,18 @@
|
|
|
132
145
|
"react-native-device-info": ">=13.0.0",
|
|
133
146
|
"react-native-fs": ">=2.20.0",
|
|
134
147
|
"react-native-get-random-values": ">=1.11.0",
|
|
148
|
+
"react-native-incall-manager": ">=4.2.0",
|
|
135
149
|
"react-native-nfc-manager": ">=3.16.2",
|
|
136
150
|
"react-native-safe-area-context": ">=5.5.2",
|
|
137
151
|
"react-native-screens": ">=4.18.0",
|
|
152
|
+
"react-native-sse": ">=1.1.0",
|
|
138
153
|
"react-native-svg": ">=15.12.0",
|
|
139
154
|
"react-native-tts": ">=4.1.1",
|
|
140
155
|
"react-native-video": ">=6.16.1",
|
|
141
|
-
"react-native-
|
|
156
|
+
"react-native-vision-camera": ">=4.7.1",
|
|
157
|
+
"react-native-webrtc": ">=124.0.0",
|
|
158
|
+
"react-native-webview": ">=13.15.0",
|
|
159
|
+
"react-native-worklets-core": ">=1.6.2"
|
|
142
160
|
},
|
|
143
161
|
"peerDependenciesMeta": {
|
|
144
162
|
"@react-navigation/native": {
|
|
@@ -168,6 +186,9 @@
|
|
|
168
186
|
"react-native-get-random-values": {
|
|
169
187
|
"optional": false
|
|
170
188
|
},
|
|
189
|
+
"react-native-incall-manager": {
|
|
190
|
+
"optional": false
|
|
191
|
+
},
|
|
171
192
|
"react-native-nfc-manager": {
|
|
172
193
|
"optional": false
|
|
173
194
|
},
|
|
@@ -177,6 +198,9 @@
|
|
|
177
198
|
"react-native-screens": {
|
|
178
199
|
"optional": false
|
|
179
200
|
},
|
|
201
|
+
"react-native-sse": {
|
|
202
|
+
"optional": false
|
|
203
|
+
},
|
|
180
204
|
"react-native-svg": {
|
|
181
205
|
"optional": false
|
|
182
206
|
},
|
|
@@ -186,6 +210,12 @@
|
|
|
186
210
|
"react-native-video": {
|
|
187
211
|
"optional": false
|
|
188
212
|
},
|
|
213
|
+
"react-native-vision-camera": {
|
|
214
|
+
"optional": false
|
|
215
|
+
},
|
|
216
|
+
"react-native-webrtc": {
|
|
217
|
+
"optional": false
|
|
218
|
+
},
|
|
189
219
|
"react-native-webview": {
|
|
190
220
|
"optional": false
|
|
191
221
|
}
|
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
import React, { useState, useRef, useCallback } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
View,
|
|
4
|
+
StyleSheet,
|
|
5
|
+
Text,
|
|
6
|
+
ScrollView,
|
|
7
|
+
StatusBar,
|
|
8
|
+
TouchableOpacity,
|
|
9
|
+
type NativeSyntheticEvent,
|
|
10
|
+
type LayoutChangeEvent,
|
|
11
|
+
} from 'react-native';
|
|
12
|
+
import { SafeAreaView } from 'react-native-safe-area-context';
|
|
13
|
+
import {
|
|
14
|
+
TrustchexCamera,
|
|
15
|
+
type TrustchexCameraHandle,
|
|
16
|
+
type Frame,
|
|
17
|
+
type NativeBarcode,
|
|
18
|
+
} from '../../Shared/Components/TrustchexCamera';
|
|
19
|
+
import { useKeepAwake } from '../../Shared/Libs/native-keep-awake.utils';
|
|
20
|
+
|
|
21
|
+
// ML Kit barcode format constants
|
|
22
|
+
const BARCODE_FORMAT_NAMES: Record<number, string> = {
|
|
23
|
+
1: 'Code 128',
|
|
24
|
+
2: 'Code 39',
|
|
25
|
+
4: 'Code 93',
|
|
26
|
+
8: 'Codabar',
|
|
27
|
+
16: 'Data Matrix',
|
|
28
|
+
32: 'EAN-13',
|
|
29
|
+
64: 'EAN-8',
|
|
30
|
+
128: 'ITF',
|
|
31
|
+
256: 'QR Code',
|
|
32
|
+
512: 'UPC-A',
|
|
33
|
+
1024: 'UPC-E',
|
|
34
|
+
2048: 'PDF417',
|
|
35
|
+
4096: 'Aztec',
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
function formatName(format: number): string {
|
|
39
|
+
return BARCODE_FORMAT_NAMES[format] ?? `Format(${format})`;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
interface BarcodeEntry {
|
|
43
|
+
rawValue: string;
|
|
44
|
+
displayValue: string;
|
|
45
|
+
format: number;
|
|
46
|
+
timestamp: number;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const BarcodeTestScreen = () => {
|
|
50
|
+
useKeepAwake();
|
|
51
|
+
const cameraRef = useRef<TrustchexCameraHandle>(null);
|
|
52
|
+
const [barcodes, setBarcodes] = useState<NativeBarcode[]>([]);
|
|
53
|
+
const [history, setHistory] = useState<BarcodeEntry[]>([]);
|
|
54
|
+
const [isPaused, setIsPaused] = useState<boolean>(false);
|
|
55
|
+
const [cameraLayout, setCameraLayout] = useState({ width: 1, height: 1 });
|
|
56
|
+
const [frameSize, setFrameSize] = useState({ width: 1080, height: 1920 });
|
|
57
|
+
|
|
58
|
+
const handleCameraLayout = useCallback((e: LayoutChangeEvent) => {
|
|
59
|
+
const { width, height } = e.nativeEvent.layout;
|
|
60
|
+
setCameraLayout({ width, height });
|
|
61
|
+
}, []);
|
|
62
|
+
|
|
63
|
+
const handleFrame = useCallback(
|
|
64
|
+
(event: NativeSyntheticEvent<{ frame: Frame }>) => {
|
|
65
|
+
if (isPaused) return;
|
|
66
|
+
|
|
67
|
+
const frame = event.nativeEvent.frame;
|
|
68
|
+
|
|
69
|
+
if (frame.width && frame.height) {
|
|
70
|
+
setFrameSize({ width: frame.width, height: frame.height });
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (frame.barcodes && frame.barcodes.length > 0) {
|
|
74
|
+
setBarcodes(frame.barcodes);
|
|
75
|
+
|
|
76
|
+
setHistory((prev) => {
|
|
77
|
+
const incoming = frame.barcodes!;
|
|
78
|
+
const next = [...prev];
|
|
79
|
+
for (const b of incoming) {
|
|
80
|
+
const alreadyRecent = next
|
|
81
|
+
.slice(0, 5)
|
|
82
|
+
.some((h) => h.rawValue === b.rawValue);
|
|
83
|
+
if (!alreadyRecent) {
|
|
84
|
+
next.unshift({
|
|
85
|
+
rawValue: b.rawValue,
|
|
86
|
+
displayValue: b.displayValue,
|
|
87
|
+
format: b.format,
|
|
88
|
+
timestamp: Date.now(),
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return next.slice(0, 30);
|
|
93
|
+
});
|
|
94
|
+
} else {
|
|
95
|
+
setBarcodes([]);
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
[isPaused]
|
|
99
|
+
);
|
|
100
|
+
|
|
101
|
+
return (
|
|
102
|
+
<View style={styles.container}>
|
|
103
|
+
<StatusBar
|
|
104
|
+
barStyle="light-content"
|
|
105
|
+
backgroundColor="transparent"
|
|
106
|
+
translucent
|
|
107
|
+
/>
|
|
108
|
+
<View style={styles.cameraWrapper} onLayout={handleCameraLayout}>
|
|
109
|
+
<TrustchexCamera
|
|
110
|
+
ref={cameraRef}
|
|
111
|
+
style={StyleSheet.absoluteFill}
|
|
112
|
+
cameraType="back"
|
|
113
|
+
enableFrameProcessing={true}
|
|
114
|
+
enableFaceDetection={false}
|
|
115
|
+
enableTextRecognition={false}
|
|
116
|
+
enableBarcodeScanning={true}
|
|
117
|
+
includeBase64={false}
|
|
118
|
+
targetFps={15}
|
|
119
|
+
onFrameAvailable={handleFrame}
|
|
120
|
+
/>
|
|
121
|
+
{barcodes.map((b, i) => {
|
|
122
|
+
const bb = b.boundingBox;
|
|
123
|
+
if (!bb) return null;
|
|
124
|
+
const scaleX = cameraLayout.width / frameSize.width;
|
|
125
|
+
const scaleY = cameraLayout.height / frameSize.height;
|
|
126
|
+
const left = bb.left * scaleX;
|
|
127
|
+
const top = bb.top * scaleY;
|
|
128
|
+
const width = (bb.right - bb.left) * scaleX;
|
|
129
|
+
const height = (bb.bottom - bb.top) * scaleY;
|
|
130
|
+
return (
|
|
131
|
+
<View
|
|
132
|
+
key={i}
|
|
133
|
+
style={[styles.barcodeBoundingBox, { left, top, width, height }]}
|
|
134
|
+
>
|
|
135
|
+
<View style={styles.barcodeBoxLabel}>
|
|
136
|
+
<Text style={styles.barcodeBoxLabelText}>
|
|
137
|
+
{formatName(b.format)}
|
|
138
|
+
</Text>
|
|
139
|
+
</View>
|
|
140
|
+
</View>
|
|
141
|
+
);
|
|
142
|
+
})}
|
|
143
|
+
</View>
|
|
144
|
+
|
|
145
|
+
<SafeAreaView style={styles.panel} edges={['bottom']}>
|
|
146
|
+
<ScrollView style={styles.scrollView}>
|
|
147
|
+
<View style={styles.panelContent}>
|
|
148
|
+
<TouchableOpacity
|
|
149
|
+
style={styles.pauseButton}
|
|
150
|
+
onPress={() => setIsPaused(!isPaused)}
|
|
151
|
+
>
|
|
152
|
+
<Text style={styles.pauseButtonText}>
|
|
153
|
+
{isPaused ? 'Resume Processing' : 'Pause Processing'}
|
|
154
|
+
</Text>
|
|
155
|
+
</TouchableOpacity>
|
|
156
|
+
|
|
157
|
+
<Text style={styles.title}>Barcode Scanner</Text>
|
|
158
|
+
|
|
159
|
+
<Text style={styles.sectionTitle}>Live Detections</Text>
|
|
160
|
+
{barcodes.length === 0 ? (
|
|
161
|
+
<Text style={styles.bodyText}>No barcode in frame</Text>
|
|
162
|
+
) : (
|
|
163
|
+
barcodes.map((b, i) => (
|
|
164
|
+
<View key={i} style={styles.barcodeRow}>
|
|
165
|
+
<View style={styles.formatBadge}>
|
|
166
|
+
<Text style={styles.formatBadgeText}>
|
|
167
|
+
{formatName(b.format)}
|
|
168
|
+
</Text>
|
|
169
|
+
</View>
|
|
170
|
+
<Text style={styles.barcodeValue}>{b.rawValue}</Text>
|
|
171
|
+
</View>
|
|
172
|
+
))
|
|
173
|
+
)}
|
|
174
|
+
|
|
175
|
+
<Text style={styles.sectionTitle}>History ({history.length})</Text>
|
|
176
|
+
{history.length === 0 ? (
|
|
177
|
+
<Text style={styles.bodyText}>No barcodes detected yet</Text>
|
|
178
|
+
) : (
|
|
179
|
+
history.map((entry, i) => (
|
|
180
|
+
<View key={i} style={styles.historyRow}>
|
|
181
|
+
<View style={styles.historyMeta}>
|
|
182
|
+
<View style={styles.formatBadge}>
|
|
183
|
+
<Text style={styles.formatBadgeText}>
|
|
184
|
+
{formatName(entry.format)}
|
|
185
|
+
</Text>
|
|
186
|
+
</View>
|
|
187
|
+
<Text style={styles.historyTime}>
|
|
188
|
+
{new Date(entry.timestamp).toLocaleTimeString()}
|
|
189
|
+
</Text>
|
|
190
|
+
</View>
|
|
191
|
+
<Text style={styles.barcodeValue}>{entry.rawValue}</Text>
|
|
192
|
+
</View>
|
|
193
|
+
))
|
|
194
|
+
)}
|
|
195
|
+
</View>
|
|
196
|
+
</ScrollView>
|
|
197
|
+
</SafeAreaView>
|
|
198
|
+
</View>
|
|
199
|
+
);
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
const styles = StyleSheet.create({
|
|
203
|
+
container: {
|
|
204
|
+
flex: 1,
|
|
205
|
+
backgroundColor: '#000000',
|
|
206
|
+
},
|
|
207
|
+
cameraWrapper: {
|
|
208
|
+
flex: 2,
|
|
209
|
+
position: 'relative',
|
|
210
|
+
},
|
|
211
|
+
barcodeBoundingBox: {
|
|
212
|
+
position: 'absolute',
|
|
213
|
+
borderWidth: 2,
|
|
214
|
+
borderColor: '#00C853',
|
|
215
|
+
backgroundColor: 'rgba(0, 200, 83, 0.07)',
|
|
216
|
+
},
|
|
217
|
+
barcodeBoxLabel: {
|
|
218
|
+
position: 'absolute',
|
|
219
|
+
top: -14,
|
|
220
|
+
left: 0,
|
|
221
|
+
backgroundColor: '#00C853',
|
|
222
|
+
paddingHorizontal: 4,
|
|
223
|
+
paddingVertical: 1,
|
|
224
|
+
borderRadius: 2,
|
|
225
|
+
},
|
|
226
|
+
barcodeBoxLabelText: {
|
|
227
|
+
color: '#000000',
|
|
228
|
+
fontSize: 8,
|
|
229
|
+
fontWeight: 'bold',
|
|
230
|
+
},
|
|
231
|
+
panel: {
|
|
232
|
+
flex: 1,
|
|
233
|
+
backgroundColor: 'rgba(0, 0, 0, 0.95)',
|
|
234
|
+
borderTopWidth: 2,
|
|
235
|
+
borderTopColor: '#00C853',
|
|
236
|
+
},
|
|
237
|
+
scrollView: {
|
|
238
|
+
flex: 1,
|
|
239
|
+
},
|
|
240
|
+
panelContent: {
|
|
241
|
+
padding: 10,
|
|
242
|
+
},
|
|
243
|
+
pauseButton: {
|
|
244
|
+
alignSelf: 'center',
|
|
245
|
+
borderWidth: 1,
|
|
246
|
+
borderColor: '#00C853',
|
|
247
|
+
borderRadius: 4,
|
|
248
|
+
paddingVertical: 6,
|
|
249
|
+
paddingHorizontal: 12,
|
|
250
|
+
marginBottom: 8,
|
|
251
|
+
},
|
|
252
|
+
pauseButtonText: {
|
|
253
|
+
color: '#00C853',
|
|
254
|
+
fontSize: 10,
|
|
255
|
+
fontWeight: 'bold',
|
|
256
|
+
},
|
|
257
|
+
title: {
|
|
258
|
+
color: '#00C853',
|
|
259
|
+
fontSize: 12,
|
|
260
|
+
fontWeight: 'bold',
|
|
261
|
+
marginBottom: 8,
|
|
262
|
+
textAlign: 'center',
|
|
263
|
+
},
|
|
264
|
+
sectionTitle: {
|
|
265
|
+
color: '#00C853',
|
|
266
|
+
fontSize: 10,
|
|
267
|
+
fontWeight: 'bold',
|
|
268
|
+
marginTop: 6,
|
|
269
|
+
marginBottom: 4,
|
|
270
|
+
},
|
|
271
|
+
bodyText: {
|
|
272
|
+
color: '#888888',
|
|
273
|
+
fontSize: 9,
|
|
274
|
+
fontFamily: 'monospace',
|
|
275
|
+
},
|
|
276
|
+
barcodeRow: {
|
|
277
|
+
marginBottom: 6,
|
|
278
|
+
},
|
|
279
|
+
historyRow: {
|
|
280
|
+
marginBottom: 8,
|
|
281
|
+
borderBottomWidth: 1,
|
|
282
|
+
borderBottomColor: '#333333',
|
|
283
|
+
paddingBottom: 6,
|
|
284
|
+
},
|
|
285
|
+
historyMeta: {
|
|
286
|
+
flexDirection: 'row',
|
|
287
|
+
alignItems: 'center',
|
|
288
|
+
marginBottom: 2,
|
|
289
|
+
gap: 6,
|
|
290
|
+
},
|
|
291
|
+
formatBadge: {
|
|
292
|
+
backgroundColor: '#00C853',
|
|
293
|
+
borderRadius: 3,
|
|
294
|
+
paddingHorizontal: 5,
|
|
295
|
+
paddingVertical: 2,
|
|
296
|
+
alignSelf: 'flex-start',
|
|
297
|
+
marginBottom: 2,
|
|
298
|
+
},
|
|
299
|
+
formatBadgeText: {
|
|
300
|
+
color: '#000000',
|
|
301
|
+
fontSize: 8,
|
|
302
|
+
fontWeight: 'bold',
|
|
303
|
+
},
|
|
304
|
+
barcodeValue: {
|
|
305
|
+
color: '#FFFFFF',
|
|
306
|
+
fontSize: 9,
|
|
307
|
+
fontFamily: 'monospace',
|
|
308
|
+
lineHeight: 14,
|
|
309
|
+
},
|
|
310
|
+
historyTime: {
|
|
311
|
+
color: '#888888',
|
|
312
|
+
fontSize: 8,
|
|
313
|
+
fontFamily: 'monospace',
|
|
314
|
+
},
|
|
315
|
+
});
|
|
316
|
+
|
|
317
|
+
export default BarcodeTestScreen;
|