@transfergratis/react-native-sdk 0.1.24 → 0.1.26
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/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +12 -5
- package/android/build/intermediates/aar_main_jar/debug/syncDebugLibJars/classes.jar +0 -0
- package/android/build/intermediates/annotations_typedef_file/debug/extractDebugAnnotations/typedefs.txt +0 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +1 -1
- package/android/build/intermediates/incremental/debug-mergeJavaRes/merge-state +0 -0
- package/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +61 -59
- package/android/build/intermediates/merged_java_res/debug/mergeDebugJavaResource/feature-transfergratis-react-native-sdk.jar +0 -0
- package/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +12 -5
- package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
- package/android/build/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
- package/android/build/outputs/aar/transfergratis-react-native-sdk-debug.aar +0 -0
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +26 -34
- package/android/src/main/AndroidManifest.xml +22 -7
- package/build/components/EnhancedCameraView.web.d.ts.map +1 -1
- package/build/components/EnhancedCameraView.web.js +76 -21
- package/build/components/EnhancedCameraView.web.js.map +1 -1
- package/build/components/KYCElements/AdditionalDocumentsTemplate.d.ts +12 -0
- package/build/components/KYCElements/AdditionalDocumentsTemplate.d.ts.map +1 -0
- package/build/components/KYCElements/AdditionalDocumentsTemplate.js +283 -0
- package/build/components/KYCElements/AdditionalDocumentsTemplate.js.map +1 -0
- package/build/components/KYCElements/EmailVerificationTemplate.d.ts +12 -0
- package/build/components/KYCElements/EmailVerificationTemplate.d.ts.map +1 -0
- package/build/components/KYCElements/EmailVerificationTemplate.js +212 -0
- package/build/components/KYCElements/EmailVerificationTemplate.js.map +1 -0
- package/build/components/KYCElements/IDCardCapture.d.ts.map +1 -1
- package/build/components/KYCElements/IDCardCapture.js +216 -14
- package/build/components/KYCElements/IDCardCapture.js.map +1 -1
- package/build/components/KYCElements/OrientationVideoCapture.d.ts +2 -0
- package/build/components/KYCElements/OrientationVideoCapture.d.ts.map +1 -1
- package/build/components/KYCElements/OrientationVideoCapture.js +2 -2
- package/build/components/KYCElements/OrientationVideoCapture.js.map +1 -1
- package/build/components/KYCElements/OrientationVideoCaptureEnhanced.d.ts +2 -0
- package/build/components/KYCElements/OrientationVideoCaptureEnhanced.d.ts.map +1 -1
- package/build/components/KYCElements/OrientationVideoCaptureEnhanced.js +2 -2
- package/build/components/KYCElements/OrientationVideoCaptureEnhanced.js.map +1 -1
- package/build/components/KYCElements/OrientationVideoCaptureFinal.d.ts +2 -0
- package/build/components/KYCElements/OrientationVideoCaptureFinal.d.ts.map +1 -1
- package/build/components/KYCElements/OrientationVideoCaptureFinal.js +2 -2
- package/build/components/KYCElements/OrientationVideoCaptureFinal.js.map +1 -1
- package/build/components/KYCElements/PersonalInformationTemplate.d.ts +12 -0
- package/build/components/KYCElements/PersonalInformationTemplate.d.ts.map +1 -0
- package/build/components/KYCElements/PersonalInformationTemplate.js +120 -0
- package/build/components/KYCElements/PersonalInformationTemplate.js.map +1 -0
- package/build/components/KYCElements/PhoneVerificationTemplate.d.ts +12 -0
- package/build/components/KYCElements/PhoneVerificationTemplate.d.ts.map +1 -0
- package/build/components/KYCElements/PhoneVerificationTemplate.js +185 -0
- package/build/components/KYCElements/PhoneVerificationTemplate.js.map +1 -0
- package/build/components/KYCElements/SelfieCaptureTemplate.d.ts.map +1 -1
- package/build/components/KYCElements/SelfieCaptureTemplate.js +7 -3
- package/build/components/KYCElements/SelfieCaptureTemplate.js.map +1 -1
- package/build/components/KYCElements/WelcomeTemplate.js +2 -1
- package/build/components/KYCElements/WelcomeTemplate.js.map +1 -1
- package/build/components/OverLay/type.d.ts +2 -0
- package/build/components/OverLay/type.d.ts.map +1 -1
- package/build/components/OverLay/type.js.map +1 -1
- package/build/components/TemplateKYCExample.d.ts +10 -0
- package/build/components/TemplateKYCExample.d.ts.map +1 -1
- package/build/components/TemplateKYCExample.js +7 -30
- package/build/components/TemplateKYCExample.js.map +1 -1
- package/build/components/TemplateKYCFlowRefactored.d.ts +12 -0
- package/build/components/TemplateKYCFlowRefactored.d.ts.map +1 -1
- package/build/components/TemplateKYCFlowRefactored.js +25 -3
- package/build/components/TemplateKYCFlowRefactored.js.map +1 -1
- package/build/config/KYCConfig.d.ts +14 -0
- package/build/config/KYCConfig.d.ts.map +1 -0
- package/build/config/KYCConfig.js +26 -0
- package/build/config/KYCConfig.js.map +1 -0
- package/build/config/allowedDomains.d.ts.map +1 -1
- package/build/config/allowedDomains.js +4 -19
- package/build/config/allowedDomains.js.map +1 -1
- package/build/hooks/useOrientationVideo.d.ts +2 -1
- package/build/hooks/useOrientationVideo.d.ts.map +1 -1
- package/build/hooks/useOrientationVideo.js +3 -3
- package/build/hooks/useOrientationVideo.js.map +1 -1
- package/build/hooks/useTemplateKYCFlow.d.ts +18 -1
- package/build/hooks/useTemplateKYCFlow.d.ts.map +1 -1
- package/build/hooks/useTemplateKYCFlow.js +410 -56
- package/build/hooks/useTemplateKYCFlow.js.map +1 -1
- package/build/i18n/en/index.d.ts +42 -0
- package/build/i18n/en/index.d.ts.map +1 -1
- package/build/i18n/en/index.js +44 -2
- package/build/i18n/en/index.js.map +1 -1
- package/build/i18n/fr/index.d.ts +28 -0
- package/build/i18n/fr/index.d.ts.map +1 -1
- package/build/i18n/fr/index.js +30 -2
- package/build/i18n/fr/index.js.map +1 -1
- package/build/i18n/types.d.ts +2 -0
- package/build/i18n/types.d.ts.map +1 -1
- package/build/i18n/types.js.map +1 -1
- package/build/index.d.ts +1 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +2 -0
- package/build/index.js.map +1 -1
- package/build/modules/api/CardAuthentification.d.ts +24 -3
- package/build/modules/api/CardAuthentification.d.ts.map +1 -1
- package/build/modules/api/CardAuthentification.js +90 -12
- package/build/modules/api/CardAuthentification.js.map +1 -1
- package/build/modules/api/KYCService.d.ts +17 -7
- package/build/modules/api/KYCService.d.ts.map +1 -1
- package/build/modules/api/KYCService.js +125 -37
- package/build/modules/api/KYCService.js.map +1 -1
- package/build/modules/api/SelfieVerification.d.ts +3 -1
- package/build/modules/api/SelfieVerification.d.ts.map +1 -1
- package/build/modules/api/SelfieVerification.js +17 -1
- package/build/modules/api/SelfieVerification.js.map +1 -1
- package/build/modules/api/TemplateService.d.ts +0 -1
- package/build/modules/api/TemplateService.d.ts.map +1 -1
- package/build/modules/api/TemplateService.js +3 -3
- package/build/modules/api/TemplateService.js.map +1 -1
- package/build/modules/camera/VisionCameraModule.web.d.ts.map +1 -1
- package/build/modules/camera/VisionCameraModule.web.js +27 -8
- package/build/modules/camera/VisionCameraModule.web.js.map +1 -1
- package/build/types/KYC.types.d.ts +130 -5
- package/build/types/KYC.types.d.ts.map +1 -1
- package/build/types/KYC.types.js.map +1 -1
- package/build/types/env.types.d.ts +13 -0
- package/build/types/env.types.d.ts.map +1 -0
- package/build/types/env.types.js +2 -0
- package/build/types/env.types.js.map +1 -0
- package/build/utils/cropByObb.d.ts +7 -0
- package/build/utils/cropByObb.d.ts.map +1 -1
- package/build/utils/cropByObb.js +20 -1
- package/build/utils/cropByObb.js.map +1 -1
- package/build/utils/deviceDetection.d.ts +6 -0
- package/build/utils/deviceDetection.d.ts.map +1 -0
- package/build/utils/deviceDetection.js +12 -0
- package/build/utils/deviceDetection.js.map +1 -0
- package/build/utils/platformAlert.d.ts.map +1 -1
- package/build/utils/platformAlert.js.map +1 -1
- package/build/utils/template-transformer.d.ts.map +1 -1
- package/build/utils/template-transformer.js +12 -0
- package/build/utils/template-transformer.js.map +1 -1
- package/build/web/WebKYCEntry.d.ts.map +1 -1
- package/build/web/WebKYCEntry.js +88 -38
- package/build/web/WebKYCEntry.js.map +1 -1
- package/package.json +1 -1
- package/plugin/build/index.d.ts +1 -0
- package/plugin/build/index.js +3 -1
- package/plugin/build/withRemovePermissions.d.ts +3 -0
- package/plugin/build/withRemovePermissions.js +67 -0
- package/plugin/build/withVisionCamera.js +3 -4
- package/plugin/src/index.ts +2 -1
- package/plugin/src/withRemovePermissions.js +85 -0
- package/plugin/src/withRemovePermissions.ts +83 -0
- package/plugin/src/withVisionCamera.js +3 -4
- package/plugin/src/withVisionCamera.ts +3 -4
- package/plugin/tsconfig.tsbuildinfo +1 -1
- package/plugin.js +6 -1
- package/src/components/EnhancedCameraView.web.tsx +76 -21
- package/src/components/KYCElements/AdditionalDocumentsTemplate.tsx +346 -0
- package/src/components/KYCElements/EmailVerificationTemplate.tsx +278 -0
- package/src/components/KYCElements/IDCardCapture.tsx +253 -21
- package/src/components/KYCElements/OrientationVideoCapture.tsx +4 -1
- package/src/components/KYCElements/OrientationVideoCaptureEnhanced.tsx +4 -1
- package/src/components/KYCElements/OrientationVideoCaptureFinal.tsx +4 -1
- package/src/components/KYCElements/PersonalInformationTemplate.tsx +158 -0
- package/src/components/KYCElements/PhoneVerificationTemplate.tsx +253 -0
- package/src/components/KYCElements/SelfieCaptureTemplate.tsx +6 -3
- package/src/components/KYCElements/WelcomeTemplate.tsx +2 -1
- package/src/components/OverLay/type.ts +2 -0
- package/src/components/TemplateKYCExample.tsx +35 -46
- package/src/components/TemplateKYCFlowRefactored.tsx +46 -2
- package/src/config/KYCConfig.ts +34 -0
- package/src/config/allowedDomains.ts +7 -26
- package/src/hooks/useOrientationVideo.ts +5 -4
- package/src/hooks/useTemplateKYCFlow.tsx +443 -56
- package/src/i18n/en/index.ts +46 -3
- package/src/i18n/fr/index.ts +31 -2
- package/src/i18n/types.ts +2 -0
- package/src/index.ts +3 -0
- package/src/modules/api/CardAuthentification.ts +98 -12
- package/src/modules/api/KYCService.ts +158 -37
- package/src/modules/api/SelfieVerification.ts +25 -3
- package/src/modules/api/TemplateService.ts +4 -4
- package/src/modules/camera/VisionCameraModule.web.ts +30 -12
- package/src/types/KYC.types.ts +153 -6
- package/src/types/env.types.ts +13 -0
- package/src/utils/cropByObb.ts +20 -1
- package/src/utils/deviceDetection.ts +11 -0
- package/src/utils/platformAlert.ts +1 -0
- package/src/utils/template-transformer.ts +20 -8
- package/src/web/WebKYCEntry.tsx +123 -61
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="utf-8"?>
|
|
2
2
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
3
|
+
xmlns:tools="http://schemas.android.com/tools"
|
|
3
4
|
package="kyc.transfergratis.com" >
|
|
4
5
|
|
|
5
6
|
<uses-sdk android:minSdkVersion="24" />
|
|
6
7
|
|
|
7
|
-
<!--
|
|
8
|
+
<!--
|
|
9
|
+
Permissions nécessaires pour KYC:
|
|
10
|
+
- CAMERA: pour capturer photos de documents et selfies
|
|
11
|
+
- RECORD_AUDIO: pour l'enregistrement vidéo (si nécessaire)
|
|
12
|
+
|
|
13
|
+
Note: READ_MEDIA_IMAGES et READ_EXTERNAL_STORAGE ne sont PAS nécessaires car:
|
|
14
|
+
- Les photos sont prises directement avec la caméra (pas besoin d'accéder à la galerie)
|
|
15
|
+
- Les photos sont sauvegardées dans le stockage interne de l'app (documentDirectory)
|
|
16
|
+
- La sélection de fichiers utilise le Photo Picker API d'Android qui ne nécessite pas de permissions
|
|
17
|
+
-->
|
|
8
18
|
<uses-permission android:name="android.permission.CAMERA" />
|
|
9
19
|
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
|
10
|
-
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
|
11
|
-
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
|
12
|
-
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
|
|
13
20
|
|
|
14
21
|
<!-- Features nécessaires -->
|
|
15
22
|
<uses-feature
|
|
@@ -19,7 +26,7 @@
|
|
|
19
26
|
android:name="android.hardware.camera.autofocus"
|
|
20
27
|
android:required="false" />
|
|
21
28
|
|
|
22
|
-
<application>
|
|
29
|
+
<application android:requestLegacyExternalStorage="false" >
|
|
23
30
|
|
|
24
31
|
<!-- FileProvider pour partager les fichiers -->
|
|
25
32
|
<provider
|
|
Binary file
|
|
File without changes
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
#
|
|
1
|
+
#Fri Jan 30 10:38:04 WAT 2026
|
|
2
2
|
kyc.transfergratis.com.transfergratis-react-native-sdk-main-6\:/xml/file_paths.xml=/Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/build/intermediates/packaged_res/debug/packageDebugResources/xml/file_paths.xml
|
|
@@ -1,61 +1,63 @@
|
|
|
1
1
|
1<?xml version="1.0" encoding="utf-8"?>
|
|
2
2
|
2<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
3
|
-
3
|
|
4
|
-
4
|
|
5
|
-
5
|
|
6
|
-
6
|
|
7
|
-
7
|
|
8
|
-
8
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
21
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
23
|
|
41
|
-
24
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
3
|
+
3 xmlns:tools="http://schemas.android.com/tools"
|
|
4
|
+
4 package="kyc.transfergratis.com" >
|
|
5
|
+
5
|
|
6
|
+
6 <uses-sdk android:minSdkVersion="24" />
|
|
7
|
+
7
|
|
8
|
+
8 <!--
|
|
9
|
+
9 Permissions nécessaires pour KYC:
|
|
10
|
+
10 - CAMERA: pour capturer photos de documents et selfies
|
|
11
|
+
11 - RECORD_AUDIO: pour l'enregistrement vidéo (si nécessaire)
|
|
12
|
+
12
|
|
13
|
+
13 Note: READ_MEDIA_IMAGES et READ_EXTERNAL_STORAGE ne sont PAS nécessaires car:
|
|
14
|
+
14 - Les photos sont prises directement avec la caméra (pas besoin d'accéder à la galerie)
|
|
15
|
+
15 - Les photos sont sauvegardées dans le stockage interne de l'app (documentDirectory)
|
|
16
|
+
16 - La sélection de fichiers utilise le Photo Picker API d'Android qui ne nécessite pas de permissions
|
|
17
|
+
17 -->
|
|
18
|
+
18 <uses-permission android:name="android.permission.CAMERA" />
|
|
19
|
+
18-->/Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:16:5-65
|
|
20
|
+
18-->/Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:16:22-62
|
|
21
|
+
19 <uses-permission android:name="android.permission.RECORD_AUDIO" />
|
|
22
|
+
19-->/Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:17:5-71
|
|
23
|
+
19-->/Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:17:22-68
|
|
24
|
+
20
|
|
25
|
+
21 <!-- Features nécessaires -->
|
|
26
|
+
22 <uses-feature
|
|
27
|
+
22-->/Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:20:5-84
|
|
28
|
+
23 android:name="android.hardware.camera"
|
|
29
|
+
23-->/Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:20:19-57
|
|
30
|
+
24 android:required="true" />
|
|
31
|
+
24-->/Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:20:58-81
|
|
32
|
+
25 <uses-feature
|
|
33
|
+
25-->/Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:21:5-95
|
|
34
|
+
26 android:name="android.hardware.camera.autofocus"
|
|
35
|
+
26-->/Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:21:19-67
|
|
36
|
+
27 android:required="false" />
|
|
37
|
+
27-->/Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:21:68-92
|
|
38
|
+
28
|
|
39
|
+
29 <application android:requestLegacyExternalStorage="false" >
|
|
40
|
+
29-->/Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:23:5-35:19
|
|
41
|
+
29-->/Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:24:9-53
|
|
42
|
+
30
|
|
43
|
+
31 <!-- FileProvider pour partager les fichiers -->
|
|
44
|
+
32 <provider
|
|
45
|
+
32-->/Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:26:9-34:20
|
|
46
|
+
33 android:name="androidx.core.content.FileProvider"
|
|
47
|
+
33-->/Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:27:13-62
|
|
48
|
+
34 android:authorities="${applicationId}.fileprovider"
|
|
49
|
+
34-->/Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:28:13-64
|
|
50
|
+
35 android:exported="false"
|
|
51
|
+
35-->/Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:29:13-37
|
|
52
|
+
36 android:grantUriPermissions="true" >
|
|
53
|
+
36-->/Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:30:13-47
|
|
54
|
+
37 <meta-data
|
|
55
|
+
37-->/Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:31:13-33:54
|
|
56
|
+
38 android:name="android.support.FILE_PROVIDER_PATHS"
|
|
57
|
+
38-->/Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:32:17-67
|
|
58
|
+
39 android:resource="@xml/file_paths" />
|
|
59
|
+
39-->/Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:33:17-51
|
|
60
|
+
40 </provider>
|
|
61
|
+
41 </application>
|
|
62
|
+
42
|
|
63
|
+
43</manifest>
|
|
Binary file
|
package/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml
CHANGED
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="utf-8"?>
|
|
2
2
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
3
|
+
xmlns:tools="http://schemas.android.com/tools"
|
|
3
4
|
package="kyc.transfergratis.com" >
|
|
4
5
|
|
|
5
6
|
<uses-sdk android:minSdkVersion="24" />
|
|
6
7
|
|
|
7
|
-
<!--
|
|
8
|
+
<!--
|
|
9
|
+
Permissions nécessaires pour KYC:
|
|
10
|
+
- CAMERA: pour capturer photos de documents et selfies
|
|
11
|
+
- RECORD_AUDIO: pour l'enregistrement vidéo (si nécessaire)
|
|
12
|
+
|
|
13
|
+
Note: READ_MEDIA_IMAGES et READ_EXTERNAL_STORAGE ne sont PAS nécessaires car:
|
|
14
|
+
- Les photos sont prises directement avec la caméra (pas besoin d'accéder à la galerie)
|
|
15
|
+
- Les photos sont sauvegardées dans le stockage interne de l'app (documentDirectory)
|
|
16
|
+
- La sélection de fichiers utilise le Photo Picker API d'Android qui ne nécessite pas de permissions
|
|
17
|
+
-->
|
|
8
18
|
<uses-permission android:name="android.permission.CAMERA" />
|
|
9
19
|
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
|
10
|
-
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
|
11
|
-
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
|
12
|
-
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
|
|
13
20
|
|
|
14
21
|
<!-- Features nécessaires -->
|
|
15
22
|
<uses-feature
|
|
@@ -19,7 +26,7 @@
|
|
|
19
26
|
android:name="android.hardware.camera.autofocus"
|
|
20
27
|
android:required="false" />
|
|
21
28
|
|
|
22
|
-
<application>
|
|
29
|
+
<application android:requestLegacyExternalStorage="false" >
|
|
23
30
|
|
|
24
31
|
<!-- FileProvider pour partager les fichiers -->
|
|
25
32
|
<provider
|
|
Binary file
|
|
Binary file
|
|
@@ -1,62 +1,54 @@
|
|
|
1
1
|
-- Merging decision tree log ---
|
|
2
2
|
manifest
|
|
3
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:2:1-
|
|
4
|
-
INJECTED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:2:1-
|
|
3
|
+
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:2:1-37:12
|
|
4
|
+
INJECTED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:2:1-37:12
|
|
5
5
|
package
|
|
6
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:
|
|
6
|
+
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:4:5-37
|
|
7
7
|
INJECTED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml
|
|
8
|
+
xmlns:tools
|
|
9
|
+
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:3:5-51
|
|
8
10
|
xmlns:android
|
|
9
11
|
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:2:11-69
|
|
10
12
|
uses-permission#android.permission.CAMERA
|
|
11
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:
|
|
13
|
+
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:16:5-65
|
|
12
14
|
android:name
|
|
13
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:
|
|
15
|
+
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:16:22-62
|
|
14
16
|
uses-permission#android.permission.RECORD_AUDIO
|
|
15
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:
|
|
17
|
+
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:17:5-71
|
|
16
18
|
android:name
|
|
17
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:
|
|
18
|
-
uses-permission#android.permission.READ_EXTERNAL_STORAGE
|
|
19
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:8:5-80
|
|
20
|
-
android:name
|
|
21
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:8:22-77
|
|
22
|
-
uses-permission#android.permission.WRITE_EXTERNAL_STORAGE
|
|
23
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:9:5-81
|
|
24
|
-
android:name
|
|
25
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:9:22-78
|
|
26
|
-
uses-permission#android.permission.MANAGE_EXTERNAL_STORAGE
|
|
27
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:10:5-82
|
|
28
|
-
android:name
|
|
29
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:10:22-79
|
|
19
|
+
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:17:22-68
|
|
30
20
|
uses-feature#android.hardware.camera
|
|
31
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:
|
|
21
|
+
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:20:5-84
|
|
32
22
|
android:required
|
|
33
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:
|
|
23
|
+
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:20:58-81
|
|
34
24
|
android:name
|
|
35
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:
|
|
25
|
+
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:20:19-57
|
|
36
26
|
uses-feature#android.hardware.camera.autofocus
|
|
37
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:
|
|
27
|
+
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:21:5-95
|
|
38
28
|
android:required
|
|
39
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:
|
|
29
|
+
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:21:68-92
|
|
40
30
|
android:name
|
|
41
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:
|
|
31
|
+
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:21:19-67
|
|
42
32
|
application
|
|
43
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:
|
|
33
|
+
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:23:5-35:19
|
|
34
|
+
android:requestLegacyExternalStorage
|
|
35
|
+
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:24:9-53
|
|
44
36
|
provider#androidx.core.content.FileProvider
|
|
45
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:
|
|
37
|
+
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:26:9-34:20
|
|
46
38
|
android:grantUriPermissions
|
|
47
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:
|
|
39
|
+
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:30:13-47
|
|
48
40
|
android:authorities
|
|
49
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:
|
|
41
|
+
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:28:13-64
|
|
50
42
|
android:exported
|
|
51
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:
|
|
43
|
+
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:29:13-37
|
|
52
44
|
android:name
|
|
53
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:
|
|
45
|
+
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:27:13-62
|
|
54
46
|
meta-data#android.support.FILE_PROVIDER_PATHS
|
|
55
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:
|
|
47
|
+
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:31:13-33:54
|
|
56
48
|
android:resource
|
|
57
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:
|
|
49
|
+
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:33:17-51
|
|
58
50
|
android:name
|
|
59
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:
|
|
51
|
+
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:32:17-67
|
|
60
52
|
uses-sdk
|
|
61
53
|
INJECTED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml reason: use-sdk injection requested
|
|
62
54
|
INJECTED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml
|
|
@@ -3,15 +3,30 @@
|
|
|
3
3
|
xmlns:tools="http://schemas.android.com/tools"
|
|
4
4
|
package="kyc.transfergratis.com">
|
|
5
5
|
|
|
6
|
-
<!--
|
|
6
|
+
<!--
|
|
7
|
+
Permissions nécessaires pour KYC:
|
|
8
|
+
- CAMERA: pour capturer photos de documents et selfies
|
|
9
|
+
- RECORD_AUDIO: pour l'enregistrement vidéo (si nécessaire)
|
|
10
|
+
|
|
11
|
+
Note: READ_MEDIA_IMAGES et READ_EXTERNAL_STORAGE ne sont PAS nécessaires car:
|
|
12
|
+
- Les photos sont prises directement avec la caméra (pas besoin d'accéder à la galerie)
|
|
13
|
+
- Les photos sont sauvegardées dans le stockage interne de l'app (documentDirectory)
|
|
14
|
+
- La sélection de fichiers utilise le Photo Picker API d'Android qui ne nécessite pas de permissions
|
|
15
|
+
-->
|
|
7
16
|
<uses-permission android:name="android.permission.CAMERA" />
|
|
8
17
|
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
|
|
18
|
+
|
|
19
|
+
<!--
|
|
20
|
+
PERMISSIONS EXPLICITEMENT BLOQUÉES (rejetées par Google Play Store pour apps KYC)
|
|
21
|
+
tools:node="remove" empêche ces permissions d'être ajoutées par les dépendances
|
|
22
|
+
-->
|
|
23
|
+
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" tools:node="remove" />
|
|
24
|
+
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" tools:node="remove" />
|
|
25
|
+
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" tools:node="remove" />
|
|
26
|
+
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" tools:node="remove" />
|
|
27
|
+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" tools:node="remove" />
|
|
28
|
+
<uses-permission android:name="android.permission.READ_CONTACTS" tools:node="remove" />
|
|
29
|
+
<uses-permission android:name="android.permission.WRITE_CONTACTS" tools:node="remove" />
|
|
15
30
|
|
|
16
31
|
<!-- Features nécessaires -->
|
|
17
32
|
<uses-feature android:name="android.hardware.camera" android:required="true" />
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnhancedCameraView.web.d.ts","sourceRoot":"","sources":["../../src/components/EnhancedCameraView.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAExE,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAIzD,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,
|
|
1
|
+
{"version":3,"file":"EnhancedCameraView.web.d.ts","sourceRoot":"","sources":["../../src/components/EnhancedCameraView.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAExE,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAIzD,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CA+chE,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
2
|
import { View, StyleSheet, TouchableOpacity, Text, Platform } from 'react-native';
|
|
3
3
|
import { useI18n } from '../hooks/useI18n';
|
|
4
|
-
export const EnhancedCameraView = ({ instructions = 'Position yourself in the frame and tap the capture button', showCamera, cameraType: initialCameraType = 'front', style, onCapture, onError, onClose, enableFlash = false, enableHdr = false, quality = 'high', showCaptureButton = true, showSwitchCamera = true, overlayComponent, bbox, canFlip = true, enableVideo = false, isRecording = false, onVideoRecordingStart, onVideoRecordingStop, videoDuration = 10, onSilentCapture, silentCaptureResult, }) => {
|
|
4
|
+
export const EnhancedCameraView = ({ instructions = 'Position yourself in the frame and tap the capture button', showCamera, cameraType: initialCameraType = 'front', style, onCapture, onError, onClose, enableFlash = false, enableHdr = false, quality = 'high', showCaptureButton = true, showSwitchCamera = true, overlayComponent, bbox, canFlip = true, enableVideo = false, isRecording = false, onVideoRecordingStart, onVideoRecordingStop, videoDuration = 10, onSilentCapture, silentCaptureResult, captureStabilizationDelayMs = 2500, }) => {
|
|
5
5
|
const { t } = useI18n();
|
|
6
6
|
// Vérification de plateforme - ce composant est uniquement pour le web
|
|
7
7
|
if (Platform.OS !== 'web') {
|
|
@@ -33,14 +33,34 @@ export const EnhancedCameraView = ({ instructions = 'Position yourself in the fr
|
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
35
|
}, [stream]);
|
|
36
|
+
// Build video constraints for quality (min + ideal improve Android/Samsung web quality; higher ideal for documents)
|
|
37
|
+
const getVideoConstraints = useCallback(() => {
|
|
38
|
+
const isHigh = quality === 'high';
|
|
39
|
+
const isMedium = quality === 'medium';
|
|
40
|
+
return {
|
|
41
|
+
facingMode: cameraType === 'front' ? 'user' : 'environment',
|
|
42
|
+
// min forces Android Chrome to use at least this resolution (avoids 640x480 default)
|
|
43
|
+
width: {
|
|
44
|
+
min: isHigh ? 1280 : isMedium ? 960 : 640,
|
|
45
|
+
ideal: isHigh ? 2560 : isMedium ? 1280 : 640,
|
|
46
|
+
},
|
|
47
|
+
height: {
|
|
48
|
+
min: isHigh ? 720 : isMedium ? 540 : 480,
|
|
49
|
+
ideal: isHigh ? 1440 : isMedium ? 720 : 480,
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
}, [cameraType, quality]);
|
|
36
53
|
const checkPermissions = async () => {
|
|
37
54
|
try {
|
|
38
55
|
if (!navigator.mediaDevices || !navigator.mediaDevices.getUserMedia) {
|
|
39
56
|
onError?.({ message: 'Camera not supported in this browser' });
|
|
40
57
|
return;
|
|
41
58
|
}
|
|
42
|
-
//
|
|
43
|
-
const stream = await navigator.mediaDevices.getUserMedia({
|
|
59
|
+
// Use same constraints as startCamera so Android Chrome doesn't cache low resolution (e.g. 640x480)
|
|
60
|
+
const stream = await navigator.mediaDevices.getUserMedia({
|
|
61
|
+
video: getVideoConstraints(),
|
|
62
|
+
audio: enableVideo,
|
|
63
|
+
});
|
|
44
64
|
stream.getTracks().forEach(track => track.stop());
|
|
45
65
|
setHasPermission(true);
|
|
46
66
|
await startCamera();
|
|
@@ -56,14 +76,31 @@ export const EnhancedCameraView = ({ instructions = 'Position yourself in the fr
|
|
|
56
76
|
stream.getTracks().forEach(track => track.stop());
|
|
57
77
|
}
|
|
58
78
|
const constraints = {
|
|
59
|
-
video:
|
|
60
|
-
facingMode: cameraType === 'front' ? 'user' : 'environment',
|
|
61
|
-
width: { ideal: quality === 'high' ? 1920 : quality === 'medium' ? 1280 : 640 },
|
|
62
|
-
height: { ideal: quality === 'high' ? 1080 : quality === 'medium' ? 720 : 480 },
|
|
63
|
-
},
|
|
79
|
+
video: getVideoConstraints(),
|
|
64
80
|
audio: enableVideo,
|
|
65
81
|
};
|
|
66
|
-
|
|
82
|
+
let newStream;
|
|
83
|
+
try {
|
|
84
|
+
newStream = await navigator.mediaDevices.getUserMedia(constraints);
|
|
85
|
+
}
|
|
86
|
+
catch (err) {
|
|
87
|
+
const name = err instanceof Error ? err.name : '';
|
|
88
|
+
// On some Android devices, min constraints can fail; fallback to ideal only
|
|
89
|
+
if (name === 'OverconstrainedError') {
|
|
90
|
+
const fallbackConstraints = {
|
|
91
|
+
video: {
|
|
92
|
+
facingMode: cameraType === 'front' ? 'user' : 'environment',
|
|
93
|
+
width: { ideal: quality === 'high' ? 2560 : quality === 'medium' ? 1280 : 640 },
|
|
94
|
+
height: { ideal: quality === 'high' ? 1440 : quality === 'medium' ? 720 : 480 },
|
|
95
|
+
},
|
|
96
|
+
audio: enableVideo,
|
|
97
|
+
};
|
|
98
|
+
newStream = await navigator.mediaDevices.getUserMedia(fallbackConstraints);
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
throw err;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
67
104
|
setStream(newStream);
|
|
68
105
|
if (videoRef.current) {
|
|
69
106
|
videoRef.current.srcObject = newStream;
|
|
@@ -116,10 +153,19 @@ export const EnhancedCameraView = ({ instructions = 'Position yourself in the fr
|
|
|
116
153
|
// Set canvas dimensions to match video
|
|
117
154
|
canvas.width = video.videoWidth;
|
|
118
155
|
canvas.height = video.videoHeight;
|
|
119
|
-
//
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
156
|
+
// For front camera: draw flipped so captured image matches non-mirrored preview (no mirror confusion)
|
|
157
|
+
if (cameraType === 'front') {
|
|
158
|
+
context.save();
|
|
159
|
+
context.translate(canvas.width, 0);
|
|
160
|
+
context.scale(-1, 1);
|
|
161
|
+
context.drawImage(video, 0, 0);
|
|
162
|
+
context.restore();
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
context.drawImage(video, 0, 0);
|
|
166
|
+
}
|
|
167
|
+
// Convert to base64 (0.95 for document/ID capture clarity; backend can exploit text better)
|
|
168
|
+
const imageDataUrl = canvas.toDataURL('image/jpeg', 0.95);
|
|
123
169
|
onSilentCapture?.({
|
|
124
170
|
success: true,
|
|
125
171
|
path: imageDataUrl,
|
|
@@ -132,17 +178,25 @@ export const EnhancedCameraView = ({ instructions = 'Position yourself in the fr
|
|
|
132
178
|
error: error instanceof Error ? error.message : 'Failed to capture photo',
|
|
133
179
|
});
|
|
134
180
|
}
|
|
135
|
-
}, [isInitialized, onError, onSilentCapture]);
|
|
136
|
-
//
|
|
181
|
+
}, [isInitialized, cameraType, onError, onSilentCapture]);
|
|
182
|
+
// Stabilization delay then auto-capture every 5s; stop as soon as capture is validated (no more new captures)
|
|
137
183
|
useEffect(() => {
|
|
138
|
-
if (!showCamera || !isInitialized) {
|
|
184
|
+
if (!showCamera || !isInitialized || silentCaptureResult?.success) {
|
|
139
185
|
return;
|
|
140
186
|
}
|
|
141
|
-
const
|
|
187
|
+
const delayMs = Math.max(0, captureStabilizationDelayMs);
|
|
188
|
+
const intervalMs = 5000;
|
|
189
|
+
let intervalId = null;
|
|
190
|
+
const timeoutId = setTimeout(() => {
|
|
142
191
|
captureSilentPhoto();
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
192
|
+
intervalId = setInterval(captureSilentPhoto, intervalMs);
|
|
193
|
+
}, delayMs);
|
|
194
|
+
return () => {
|
|
195
|
+
clearTimeout(timeoutId);
|
|
196
|
+
if (intervalId)
|
|
197
|
+
clearInterval(intervalId);
|
|
198
|
+
};
|
|
199
|
+
}, [showCamera, isInitialized, captureStabilizationDelayMs, captureSilentPhoto, silentCaptureResult?.success]);
|
|
146
200
|
const startVideoRecording = useCallback(async () => {
|
|
147
201
|
try {
|
|
148
202
|
if (!stream || !isInitialized) {
|
|
@@ -233,12 +287,13 @@ export const EnhancedCameraView = ({ instructions = 'Position yourself in the fr
|
|
|
233
287
|
return <View style={[styles.container, style]}/>;
|
|
234
288
|
}
|
|
235
289
|
return (<View style={[styles.container, style]}>
|
|
236
|
-
{/* Video element */}
|
|
290
|
+
{/* Video element; no mirror for front camera so preview matches final photo and doesn't confuse users */}
|
|
237
291
|
<video ref={videoRef} style={{
|
|
238
292
|
position: 'absolute',
|
|
239
293
|
width: '100%',
|
|
240
294
|
height: '100%',
|
|
241
295
|
objectFit: 'cover',
|
|
296
|
+
transform: cameraType === 'front' ? 'scaleX(-1)' : undefined,
|
|
242
297
|
}} autoPlay playsInline muted/>
|
|
243
298
|
|
|
244
299
|
{/* Hidden canvas for photo capture */}
|