diff --git a/android/app/build.gradle b/android/app/build.gradle index 0e10a43fc..74b26791d 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -83,7 +83,6 @@ android { versionCode 126 versionName "1.0.1" multiDexEnabled true - missingDimensionStrategy 'react-native-camera', 'general' } signingConfigs { diff --git a/android/gradle.properties b/android/gradle.properties index a46a5b90f..e8c3183d3 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -39,3 +39,6 @@ newArchEnabled=false # Use this property to enable or disable the Hermes JS engine. # If set to false, you will be using JSC instead. hermesEnabled=true + +# Include MLKit model for react-native-vision-camera +VisionCamera_enableCodeScanner=true diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 137e7f4ce..96275269c 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -1111,8 +1111,6 @@ PODS: - React-jsi (= 0.73.8) - React-logger (= 0.73.8) - React-perflogger (= 0.73.8) - - ReactNativeCameraKit (14.0.0-beta13): - - React-Core - RNCAsyncStorage (1.21.0): - React-Core - RNCClipboard (1.12.1): @@ -1131,7 +1129,7 @@ PODS: - React-Core - RNLocalize (3.0.2): - React-Core - - RNPermissions (3.10.1): + - RNPermissions (4.1.5): - React-Core - RNQrGenerator (1.4.0): - React @@ -1166,6 +1164,12 @@ PODS: - RCT-Folly (= 2022.05.16.00) - React-Core - SSZipArchive (2.4.3) + - VisionCamera (4.3.1): + - VisionCamera/Core (= 4.3.1) + - VisionCamera/React (= 4.3.1) + - VisionCamera/Core (4.3.1) + - VisionCamera/React (4.3.1): + - React-Core - Yoga (1.14.0) - ZXingObjC (3.6.9): - ZXingObjC/All (= 3.6.9) @@ -1238,7 +1242,6 @@ DEPENDENCIES: - React-runtimescheduler (from `../node_modules/react-native/ReactCommon/react/renderer/runtimescheduler`) - React-utils (from `../node_modules/react-native/ReactCommon/react/utils`) - ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`) - - ReactNativeCameraKit (from `../node_modules/react-native-camera-kit`) - "RNCAsyncStorage (from `../node_modules/@react-native-async-storage/async-storage`)" - "RNCClipboard (from `../node_modules/@react-native-clipboard/clipboard`)" - RNDeviceInfo (from `../node_modules/react-native-device-info`) @@ -1257,6 +1260,7 @@ DEPENDENCIES: - RNSVG (from `../node_modules/react-native-svg`) - RNZipArchive (from `../node_modules/react-native-zip-archive`) - sodium-react-native-direct (from `../node_modules/sodium-react-native-direct`) + - VisionCamera (from `../node_modules/react-native-vision-camera`) - Yoga (from `../node_modules/react-native/ReactCommon/yoga`) SPEC REPOS: @@ -1398,8 +1402,6 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native/ReactCommon/react/utils" ReactCommon: :path: "../node_modules/react-native/ReactCommon" - ReactNativeCameraKit: - :path: "../node_modules/react-native-camera-kit" RNCAsyncStorage: :path: "../node_modules/@react-native-async-storage/async-storage" RNCClipboard: @@ -1436,6 +1438,8 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native-zip-archive" sodium-react-native-direct: :path: "../node_modules/sodium-react-native-direct" + VisionCamera: + :path: "../node_modules/react-native-vision-camera" Yoga: :path: "../node_modules/react-native/ReactCommon/yoga" @@ -1509,7 +1513,6 @@ SPEC CHECKSUMS: React-runtimescheduler: 1c40cfe98dcc7b06354d96a1cd8ee10cbc4cc797 React-utils: 4cc2ba652f5df1c8f0461d4ae9e3ee474c1354ea ReactCommon: 1da3fc14d904883c46327b3322325eebf60a720a - ReactNativeCameraKit: d95d3e19c514526a234d9f93c6db7e7f10eef9ea RNCAsyncStorage: 618d03a5f52fbccb3d7010076bc54712844c18ef RNCClipboard: d77213bfa269013bf4b857b7a9ca37ee062d8ef1 RNDeviceInfo: 4f9c7cfd6b9db1b05eb919620a001cf35b536423 @@ -1518,7 +1521,7 @@ SPEC CHECKSUMS: RNGestureHandler: 67fb54b3e6ca338a8044e85cd6f340265aa41091 RNKeychain: bfe3d12bf4620fe488771c414530bf16e88f3678 RNLocalize: dbea38dcb344bf80ff18a1757b1becf11f70cae4 - RNPermissions: 2c0eec471f4de66d04d226c339898d10a6e123c4 + RNPermissions: 8e5f8de95db3a4345df798a41c3633dc93143207 RNQrGenerator: 1676221c08bfabec978242989c733810dad20959 RNQuickAction: 6d404a869dc872cde841ad3147416a670d13fa93 RNReactNativeHapticFeedback: ec56a5f81c3941206fd85625fa669ffc7b4545f9 @@ -1530,6 +1533,7 @@ SPEC CHECKSUMS: SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17 sodium-react-native-direct: 102289e2a55688b5c6c489c88b2a7915d4e31ec1 SSZipArchive: fe6a26b2a54d5a0890f2567b5cc6de5caa600aef + VisionCamera: 58d2120e6e23c155b25f4702b7912dc2b1e5e8c2 Yoga: e5b887426cee15d2a326bdd34afc0282fc0486ad ZXingObjC: 8898711ab495761b2dbbdec76d90164a6d7e14c5 diff --git a/ios/bitkit.xcodeproj/project.pbxproj b/ios/bitkit.xcodeproj/project.pbxproj index b5e7e1d79..32097dc0e 100644 --- a/ios/bitkit.xcodeproj/project.pbxproj +++ b/ios/bitkit.xcodeproj/project.pbxproj @@ -12,16 +12,16 @@ 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 17074219BB5847259EAFC7A6 /* InterTight-Black.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 3815D562618543E7A9BC191E /* InterTight-Black.ttf */; }; - 2C3A289853B01446F26DE07D /* libPods-bitkit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5B5E78A0A99310328B7054CC /* libPods-bitkit.a */; }; 57072143CA0F49089AE64F61 /* InterTight-ExtraBold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = A223BA795CEB4CB2B344FBAF /* InterTight-ExtraBold.ttf */; }; 6132EF182BDFF13200BBE14D /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 6132EF172BDFF13200BBE14D /* PrivacyInfo.xcprivacy */; }; 6980B602E6DC4429841BE5EE /* InterTight-Medium.ttf in Resources */ = {isa = PBXBuildFile; fileRef = D67AECF5F543462F90EC89AD /* InterTight-Medium.ttf */; }; 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; 8BD8301E3A1B44DDA3C8A10D /* Damion-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = DEC74C5375A34FFCAEBA0781 /* Damion-Regular.ttf */; }; 925570EA7B1D43CC8AD07B91 /* InterTight-Bold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = CA37793F82F144678099A00D /* InterTight-Bold.ttf */; }; - 92E54D2F4FA19238DC2A9EDD /* libPods-bitkit-bitkitTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 767A7259F23E73A34CE34240 /* libPods-bitkit-bitkitTests.a */; }; 9952E811473D46FB9003A56D /* InterTight-SemiBold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 50A8DA09F2974D05A3C58E87 /* InterTight-SemiBold.ttf */; }; B3BE07A9843E4B7DA375B877 /* InterTight-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 79DFAC55B0D745DE815EC2E0 /* InterTight-Regular.ttf */; }; + E05EE5B4DEEBA3386A99C350 /* libPods-bitkit-bitkitTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 192CD8EE3BA2D38FC07BAB74 /* libPods-bitkit-bitkitTests.a */; }; + ED90E4587A2FC5B6C885512C /* libPods-bitkit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 94CB6F66DC1694FD119281FA /* libPods-bitkit.a */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -38,27 +38,27 @@ 00E356EE1AD99517003FC87E /* bitkitTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = bitkitTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 00E356F21AD99517003FC87E /* bitkitTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = bitkitTests.m; sourceTree = ""; }; + 05B6E558DB4D3F7CDD19C97B /* Pods-bitkit-bitkitTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-bitkit-bitkitTests.debug.xcconfig"; path = "Target Support Files/Pods-bitkit-bitkitTests/Pods-bitkit-bitkitTests.debug.xcconfig"; sourceTree = ""; }; 13B07F961A680F5B00A75B9A /* bitkit.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = bitkit.app; sourceTree = BUILT_PRODUCTS_DIR; }; 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = bitkit/AppDelegate.h; sourceTree = ""; }; 13B07FB01A68108700A75B9A /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AppDelegate.mm; path = bitkit/AppDelegate.mm; sourceTree = ""; }; 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = bitkit/Images.xcassets; sourceTree = ""; }; 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = bitkit/Info.plist; sourceTree = ""; }; 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = bitkit/main.m; sourceTree = ""; }; - 289DE5FD62BC39314CD28A51 /* Pods-bitkit.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-bitkit.release.xcconfig"; path = "Target Support Files/Pods-bitkit/Pods-bitkit.release.xcconfig"; sourceTree = ""; }; + 192CD8EE3BA2D38FC07BAB74 /* libPods-bitkit-bitkitTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-bitkit-bitkitTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 19DF72353A4BE1A2828B6E89 /* Pods-bitkit.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-bitkit.release.xcconfig"; path = "Target Support Files/Pods-bitkit/Pods-bitkit.release.xcconfig"; sourceTree = ""; }; 3815D562618543E7A9BC191E /* InterTight-Black.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "InterTight-Black.ttf"; path = "../src/assets/fonts/InterTight-Black.ttf"; sourceTree = ""; }; 50A8DA09F2974D05A3C58E87 /* InterTight-SemiBold.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "InterTight-SemiBold.ttf"; path = "../src/assets/fonts/InterTight-SemiBold.ttf"; sourceTree = ""; }; - 5B5E78A0A99310328B7054CC /* libPods-bitkit.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-bitkit.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 6132EF172BDFF13200BBE14D /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = PrivacyInfo.xcprivacy; path = bitkit/PrivacyInfo.xcprivacy; sourceTree = ""; }; - 6427E31D398FA605AE553E14 /* Pods-bitkit.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-bitkit.debug.xcconfig"; path = "Target Support Files/Pods-bitkit/Pods-bitkit.debug.xcconfig"; sourceTree = ""; }; - 767A7259F23E73A34CE34240 /* libPods-bitkit-bitkitTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-bitkit-bitkitTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 6E5725CB9D9FD054151545D9 /* Pods-bitkit.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-bitkit.debug.xcconfig"; path = "Target Support Files/Pods-bitkit/Pods-bitkit.debug.xcconfig"; sourceTree = ""; }; 79DFAC55B0D745DE815EC2E0 /* InterTight-Regular.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "InterTight-Regular.ttf"; path = "../src/assets/fonts/InterTight-Regular.ttf"; sourceTree = ""; }; 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = bitkit/LaunchScreen.storyboard; sourceTree = ""; }; - 8AB8522F78A39FC54A4AF279 /* Pods-bitkit-bitkitTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-bitkit-bitkitTests.release.xcconfig"; path = "Target Support Files/Pods-bitkit-bitkitTests/Pods-bitkit-bitkitTests.release.xcconfig"; sourceTree = ""; }; + 94CB6F66DC1694FD119281FA /* libPods-bitkit.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-bitkit.a"; sourceTree = BUILT_PRODUCTS_DIR; }; A223BA795CEB4CB2B344FBAF /* InterTight-ExtraBold.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "InterTight-ExtraBold.ttf"; path = "../src/assets/fonts/InterTight-ExtraBold.ttf"; sourceTree = ""; }; CA37793F82F144678099A00D /* InterTight-Bold.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "InterTight-Bold.ttf"; path = "../src/assets/fonts/InterTight-Bold.ttf"; sourceTree = ""; }; D67AECF5F543462F90EC89AD /* InterTight-Medium.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "InterTight-Medium.ttf"; path = "../src/assets/fonts/InterTight-Medium.ttf"; sourceTree = ""; }; + DA77C48198D3933D9B81AB80 /* Pods-bitkit-bitkitTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-bitkit-bitkitTests.release.xcconfig"; path = "Target Support Files/Pods-bitkit-bitkitTests/Pods-bitkit-bitkitTests.release.xcconfig"; sourceTree = ""; }; DEC74C5375A34FFCAEBA0781 /* Damion-Regular.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "Damion-Regular.ttf"; path = "../src/assets/fonts/Damion-Regular.ttf"; sourceTree = ""; }; - E59075B9660BC10C6787D7FC /* Pods-bitkit-bitkitTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-bitkit-bitkitTests.debug.xcconfig"; path = "Target Support Files/Pods-bitkit-bitkitTests/Pods-bitkit-bitkitTests.debug.xcconfig"; sourceTree = ""; }; ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; /* End PBXFileReference section */ @@ -67,7 +67,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 92E54D2F4FA19238DC2A9EDD /* libPods-bitkit-bitkitTests.a in Frameworks */, + E05EE5B4DEEBA3386A99C350 /* libPods-bitkit-bitkitTests.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -75,7 +75,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 2C3A289853B01446F26DE07D /* libPods-bitkit.a in Frameworks */, + ED90E4587A2FC5B6C885512C /* libPods-bitkit.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -117,8 +117,8 @@ isa = PBXGroup; children = ( ED297162215061F000B7C4FE /* JavaScriptCore.framework */, - 5B5E78A0A99310328B7054CC /* libPods-bitkit.a */, - 767A7259F23E73A34CE34240 /* libPods-bitkit-bitkitTests.a */, + 94CB6F66DC1694FD119281FA /* libPods-bitkit.a */, + 192CD8EE3BA2D38FC07BAB74 /* libPods-bitkit-bitkitTests.a */, ); name = Frameworks; sourceTree = ""; @@ -181,10 +181,10 @@ BBD78D7AC51CEA395F1C20DB /* Pods */ = { isa = PBXGroup; children = ( - 6427E31D398FA605AE553E14 /* Pods-bitkit.debug.xcconfig */, - 289DE5FD62BC39314CD28A51 /* Pods-bitkit.release.xcconfig */, - E59075B9660BC10C6787D7FC /* Pods-bitkit-bitkitTests.debug.xcconfig */, - 8AB8522F78A39FC54A4AF279 /* Pods-bitkit-bitkitTests.release.xcconfig */, + 6E5725CB9D9FD054151545D9 /* Pods-bitkit.debug.xcconfig */, + 19DF72353A4BE1A2828B6E89 /* Pods-bitkit.release.xcconfig */, + 05B6E558DB4D3F7CDD19C97B /* Pods-bitkit-bitkitTests.debug.xcconfig */, + DA77C48198D3933D9B81AB80 /* Pods-bitkit-bitkitTests.release.xcconfig */, ); path = Pods; sourceTree = ""; @@ -196,12 +196,12 @@ isa = PBXNativeTarget; buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "bitkitTests" */; buildPhases = ( - 50AD31A4D8B3D5ABC2CF9F23 /* [CP] Check Pods Manifest.lock */, + 714BAA78BA3127DFB5B1A844 /* [CP] Check Pods Manifest.lock */, 00E356EA1AD99517003FC87E /* Sources */, 00E356EB1AD99517003FC87E /* Frameworks */, 00E356EC1AD99517003FC87E /* Resources */, - F4275AA1FC60BD98CB8CAB8E /* [CP] Embed Pods Frameworks */, - 3473E8654EA8B89E069B7AB5 /* [CP] Copy Pods Resources */, + A127E5EE3CD3F1D5BBF5AE58 /* [CP] Embed Pods Frameworks */, + E75111FE4D06AE87F28DE0AB /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -217,13 +217,13 @@ isa = PBXNativeTarget; buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "bitkit" */; buildPhases = ( - 6AF8530F6842669322DB35B8 /* [CP] Check Pods Manifest.lock */, + 26139FB8978C9C88E0DDAFE4 /* [CP] Check Pods Manifest.lock */, 13B07F871A680F5B00A75B9A /* Sources */, 13B07F8C1A680F5B00A75B9A /* Frameworks */, 13B07F8E1A680F5B00A75B9A /* Resources */, 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, - E830198DEEFD6C742660EDEE /* [CP] Embed Pods Frameworks */, - 4B87EAB55A3BC4B38E1A62B0 /* [CP] Copy Pods Resources */, + E8035F39E6C794D11FB53071 /* [CP] Embed Pods Frameworks */, + 54AE8934EDB18A3A27BB106A /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -314,24 +314,29 @@ shellPath = /bin/sh; shellScript = "set -e\n\nWITH_ENVIRONMENT=\"../node_modules/react-native/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"../node_modules/react-native/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n"; }; - 3473E8654EA8B89E069B7AB5 /* [CP] Copy Pods Resources */ = { + 26139FB8978C9C88E0DDAFE4 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-bitkit-bitkitTests/Pods-bitkit-bitkitTests-resources-${CONFIGURATION}-input-files.xcfilelist", ); - name = "[CP] Copy Pods Resources"; + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-bitkit-bitkitTests/Pods-bitkit-bitkitTests-resources-${CONFIGURATION}-output-files.xcfilelist", + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-bitkit-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-bitkit-bitkitTests/Pods-bitkit-bitkitTests-resources.sh\"\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; - 4B87EAB55A3BC4B38E1A62B0 /* [CP] Copy Pods Resources */ = { + 54AE8934EDB18A3A27BB106A /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -348,7 +353,7 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-bitkit/Pods-bitkit-resources.sh\"\n"; showEnvVarsInLog = 0; }; - 50AD31A4D8B3D5ABC2CF9F23 /* [CP] Check Pods Manifest.lock */ = { + 714BAA78BA3127DFB5B1A844 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -370,60 +375,55 @@ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; - 6AF8530F6842669322DB35B8 /* [CP] Check Pods Manifest.lock */ = { + A127E5EE3CD3F1D5BBF5AE58 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-bitkit-bitkitTests/Pods-bitkit-bitkitTests-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; + name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-bitkit-checkManifestLockResult.txt", + "${PODS_ROOT}/Target Support Files/Pods-bitkit-bitkitTests/Pods-bitkit-bitkitTests-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-bitkit-bitkitTests/Pods-bitkit-bitkitTests-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - E830198DEEFD6C742660EDEE /* [CP] Embed Pods Frameworks */ = { + E75111FE4D06AE87F28DE0AB /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-bitkit/Pods-bitkit-frameworks-${CONFIGURATION}-input-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-bitkit-bitkitTests/Pods-bitkit-bitkitTests-resources-${CONFIGURATION}-input-files.xcfilelist", ); - name = "[CP] Embed Pods Frameworks"; + name = "[CP] Copy Pods Resources"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-bitkit/Pods-bitkit-frameworks-${CONFIGURATION}-output-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-bitkit-bitkitTests/Pods-bitkit-bitkitTests-resources-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-bitkit/Pods-bitkit-frameworks.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-bitkit-bitkitTests/Pods-bitkit-bitkitTests-resources.sh\"\n"; showEnvVarsInLog = 0; }; - F4275AA1FC60BD98CB8CAB8E /* [CP] Embed Pods Frameworks */ = { + E8035F39E6C794D11FB53071 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-bitkit-bitkitTests/Pods-bitkit-bitkitTests-frameworks-${CONFIGURATION}-input-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-bitkit/Pods-bitkit-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-bitkit-bitkitTests/Pods-bitkit-bitkitTests-frameworks-${CONFIGURATION}-output-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-bitkit/Pods-bitkit-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-bitkit-bitkitTests/Pods-bitkit-bitkitTests-frameworks.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-bitkit/Pods-bitkit-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -459,7 +459,7 @@ /* Begin XCBuildConfiguration section */ 00E356F61AD99517003FC87E /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = E59075B9660BC10C6787D7FC /* Pods-bitkit-bitkitTests.debug.xcconfig */; + baseConfigurationReference = 05B6E558DB4D3F7CDD19C97B /* Pods-bitkit-bitkitTests.debug.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; BUNDLE_LOADER = "$(TEST_HOST)"; @@ -487,7 +487,7 @@ }; 00E356F71AD99517003FC87E /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 8AB8522F78A39FC54A4AF279 /* Pods-bitkit-bitkitTests.release.xcconfig */; + baseConfigurationReference = DA77C48198D3933D9B81AB80 /* Pods-bitkit-bitkitTests.release.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; BUNDLE_LOADER = "$(TEST_HOST)"; @@ -512,7 +512,7 @@ }; 13B07F941A680F5B00A75B9A /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 6427E31D398FA605AE553E14 /* Pods-bitkit.debug.xcconfig */; + baseConfigurationReference = 6E5725CB9D9FD054151545D9 /* Pods-bitkit.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIconOrange; ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES; @@ -544,7 +544,7 @@ }; 13B07F951A680F5B00A75B9A /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 289DE5FD62BC39314CD28A51 /* Pods-bitkit.release.xcconfig */; + baseConfigurationReference = 19DF72353A4BE1A2828B6E89 /* Pods-bitkit.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIconOrange; ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES; diff --git a/package.json b/package.json index a680598cb..713bee36f 100644 --- a/package.json +++ b/package.json @@ -88,7 +88,6 @@ "react-native": "0.73.8", "react-native-address-generator": "0.3.3", "react-native-biometrics": "3.0.1", - "react-native-camera-kit": "14.0.0-beta13", "react-native-device-info": "10.13.1", "react-native-dotenv": "3.4.11", "react-native-draggable-flatlist": "4.0.1", @@ -103,7 +102,7 @@ "react-native-localize": "3.0.2", "react-native-mmkv": "2.12.2", "react-native-modal": "13.0.1", - "react-native-permissions": "3.10.1", + "react-native-permissions": "4.1.5", "react-native-polyfill-globals": "3.1.0", "react-native-qrcode-svg": "6.3.0", "react-native-quick-actions": "0.3.13", @@ -120,6 +119,7 @@ "react-native-svg": "15.1.0", "react-native-tcp-socket": "5.6.2", "react-native-toast-message": "2.2.0", + "react-native-vision-camera": "4.3.1", "react-native-zip-archive": "6.1.0", "react-redux": "9.1.1", "redux": "5.0.1", diff --git a/src/components/Camera.tsx b/src/components/Camera.tsx index 90d1f26da..abfb563d1 100644 --- a/src/components/Camera.tsx +++ b/src/components/Camera.tsx @@ -1,14 +1,26 @@ -import React, { ReactElement, useState, useEffect } from 'react'; -import { StyleSheet, Platform, View } from 'react-native'; +import React, { + ReactElement, + useState, + useEffect, + useRef, + useCallback, +} from 'react'; +import { StyleSheet } from 'react-native'; import { useIsFocused } from '@react-navigation/native'; -import { check, request, PERMISSIONS, RESULTS } from 'react-native-permissions'; -import { Camera as CameraKit, CameraType } from 'react-native-camera-kit'; -import { useTranslation } from 'react-i18next'; +import { + Camera as VisionCamera, + Point, + useCameraDevice, + useCodeScanner, + useCameraPermission, +} from 'react-native-vision-camera'; import CameraNoAuth from './CameraNoAuth'; import GradientView from './GradientView'; +import { Gesture, GestureDetector } from 'react-native-gesture-handler'; +import { runOnJS } from 'react-native-reanimated'; -enum Status { +enum EAuthStatus { AUTHORIZED = 'AUTHORIZED', NOT_AUTHORIZED = 'NOT_AUTHORIZED', UNKNOWN = 'UNKNOWN', @@ -25,72 +37,72 @@ const Camera = ({ bottomSheet?: boolean; onBarCodeRead: (data: string) => void; }): ReactElement => { - const { t } = useTranslation('other'); + const camera = useRef(null); + const scannedCode = useRef(''); const isFocused = useIsFocused(); - const [_data, setData] = useState(''); - const [cameraStatus, setCameraStatus] = useState(Status.UNKNOWN); + const [authStatus, setAuthStatus] = useState(EAuthStatus.UNKNOWN); + + const device = useCameraDevice('back'); + const { hasPermission, requestPermission } = useCameraPermission(); useEffect(() => { - (async (): Promise => { - const cameraPermission = - Platform.OS === 'ios' - ? PERMISSIONS.IOS.CAMERA - : PERMISSIONS.ANDROID.CAMERA; - const checkResponse = await check(cameraPermission); - switch (checkResponse) { - case RESULTS.UNAVAILABLE: - case RESULTS.BLOCKED: - setCameraStatus(Status.NOT_AUTHORIZED); - break; - case RESULTS.DENIED: - const rationale = { - title: t('camera_ask_title'), - message: t('camera_ask_msg'), - buttonPositive: t('ok'), - buttonNegative: t('cancel'), - }; - const requestResponse = await request(cameraPermission, rationale); - setCameraStatus( - requestResponse === RESULTS.GRANTED - ? Status.AUTHORIZED - : Status.NOT_AUTHORIZED, - ); - break; - case RESULTS.LIMITED: - case RESULTS.GRANTED: - setCameraStatus(Status.AUTHORIZED); - break; + const checkPermission = async (): Promise => { + if (hasPermission) { + setAuthStatus(EAuthStatus.AUTHORIZED); + } else { + const granted = await requestPermission(); + if (granted) { + setAuthStatus(EAuthStatus.AUTHORIZED); + } else { + setAuthStatus(EAuthStatus.NOT_AUTHORIZED); + } + } + }; + + checkPermission(); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + + const codeScanner = useCodeScanner({ + codeTypes: ['qr'], + onCodeScanned: (codes) => { + const code = codes.find((c) => c.value); + if (code?.value && scannedCode.current !== code.value) { + scannedCode.current = code.value; + onBarCodeRead(code.value); } - })(); - }, [t]); + }, + }); - const handleCodeRead = (event): void => { - const { codeStringValue } = event.nativeEvent; - if (_data !== codeStringValue) { - setData(codeStringValue); - onBarCodeRead(codeStringValue); - } - }; + const focus = useCallback((point: Point) => { + camera.current?.focus(point); + }, []); - if (!isFocused) { - return ; - } + const gesture = Gesture.Tap().onEnd(({ x, y }) => { + runOnJS(focus)({ x, y }); + }); return ( - {cameraStatus === Status.AUTHORIZED && ( + {authStatus === EAuthStatus.AUTHORIZED && ( <> - + {device && ( + + console.error(error)} + /> + + )} {children} )} - {cameraStatus === Status.NOT_AUTHORIZED && ( + {authStatus === EAuthStatus.NOT_AUTHORIZED && ( )} diff --git a/yarn.lock b/yarn.lock index 9defd01c3..d5ca8eb76 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10154,11 +10154,6 @@ react-native-bundle-visualizer@^3.1.3: open "^8.4.0" source-map-explorer "^2.5.3" -react-native-camera-kit@14.0.0-beta13: - version "14.0.0-beta13" - resolved "https://registry.yarnpkg.com/react-native-camera-kit/-/react-native-camera-kit-14.0.0-beta13.tgz#7d1c40571e7e7ce2c4b6bd6f58807f7573217c3c" - integrity sha512-49q6l/Y3j1QMUDPGqIqkUzdraNtKWVQz5X4U8qfixSe+MeWe0N1vWlWWr8iH1apxQCS5v0dKPlYot0e3VKy05g== - react-native-device-info@10.13.1: version "10.13.1" resolved "https://registry.yarnpkg.com/react-native-device-info/-/react-native-device-info-10.13.1.tgz#f87f44ba7b67933248be10ca302a4f2f6dbbdd4f" @@ -10251,10 +10246,10 @@ react-native-modal@13.0.1: prop-types "^15.6.2" react-native-animatable "1.3.3" -react-native-permissions@3.10.1: - version "3.10.1" - resolved "https://registry.yarnpkg.com/react-native-permissions/-/react-native-permissions-3.10.1.tgz#cb0171c8d12113869deaabbdfb979aad1a44752b" - integrity sha512-Gc5BxxpjZn4QNUDiVeHOO0vXh3AH7ToolmwTJozqC6DsxV7NAf3ttap+8BSmzDR8WxuAM3Cror+YNiBhHJx7/w== +react-native-permissions@4.1.5: + version "4.1.5" + resolved "https://registry.yarnpkg.com/react-native-permissions/-/react-native-permissions-4.1.5.tgz#db4d1ddbf076570043f4fd4168f54bb6020aec92" + integrity sha512-r6VMRacASmtRHS+GZ+5HQCp9p9kiE+UU9magHOZCXZLTJitdTuVHWZRrb4v4oqZGU+zAp3mZhTQftuMMv+WLUg== react-native-polyfill-globals@3.1.0: version "3.1.0" @@ -10395,6 +10390,11 @@ react-native-toast-message@2.2.0: resolved "https://registry.yarnpkg.com/react-native-toast-message/-/react-native-toast-message-2.2.0.tgz#c53a4746b15616858a7d61c4386b92cbe9fbf911" integrity sha512-AFti8VzUk6JvyGAlLm9/BknTNDXrrhqnUk7ak/pM7uCTxDPveAu2ekszU0on6vnUPFnG04H/QfYE2IlETqeaWw== +react-native-vision-camera@4.3.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/react-native-vision-camera/-/react-native-vision-camera-4.3.1.tgz#f755107f259f71f51a619ccaaefc55bbe341b2c7" + integrity sha512-7BzvZnorTQDQ5qZEOeiRpjA1BM0ZsUxxCsPtntRf1by7Ialok+gD04k285+n+7yy/2+WT4TwLSPeiAqx9z+uew== + react-native-zip-archive@6.1.0: version "6.1.0" resolved "https://registry.yarnpkg.com/react-native-zip-archive/-/react-native-zip-archive-6.1.0.tgz#beed62dea9c7ff1e4fd4b6ce0e496ede5ab2f96f"