diff --git a/android/app/build.gradle b/android/app/build.gradle index aa262f381..608b1f4ef 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -83,7 +83,6 @@ android { versionCode 128 versionName "1.0.2" multiDexEnabled true - missingDimensionStrategy 'react-native-camera', 'general' testBuildType System.getProperty('testBuildType', 'debug') testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' } diff --git a/android/gradle.properties b/android/gradle.properties index 4bf629260..e92187fc4 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 9cef528b5..9a0d8584f 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -1359,8 +1359,6 @@ PODS: - React-logger (= 0.74.3) - React-perflogger (= 0.74.3) - React-utils (= 0.74.3) - - ReactNativeCameraKit (14.0.0-beta15): - - React-Core - RNCAsyncStorage (1.22.3): - React-Core - RNCClipboard (1.14.1): @@ -1396,7 +1394,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 @@ -1482,6 +1480,12 @@ PODS: - ReactCommon/turbomodule/core - Yoga - SSZipArchive (2.4.3) + - VisionCamera (4.4.3): + - VisionCamera/Core (= 4.4.3) + - VisionCamera/React (= 4.4.3) + - VisionCamera/Core (4.4.3) + - VisionCamera/React (4.4.3): + - React-Core - Yoga (0.0.0) - ZXingObjC (3.6.9): - ZXingObjC/All (= 3.6.9) @@ -1559,7 +1563,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`) @@ -1578,6 +1581,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: @@ -1729,8 +1733,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: @@ -1767,6 +1769,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" @@ -1844,7 +1848,6 @@ SPEC CHECKSUMS: React-runtimescheduler: 0c80752bceb80924cb8a4babc2a8e3ed70d41e87 React-utils: a06061b3887c702235d2dac92dacbd93e1ea079e ReactCommon: f00e436b3925a7ae44dfa294b43ef360fbd8ccc4 - ReactNativeCameraKit: 71343efc1256720184ce980f164c7eedb78d5c16 RNCAsyncStorage: 10591b9e0a91eaffee14e69b3721009759235125 RNCClipboard: 0a720adef5ec193aa0e3de24c3977222c7e52a37 RNDeviceInfo: b899ce37a403a4dea52b7cb85e16e49c04a5b88e @@ -1853,7 +1856,7 @@ SPEC CHECKSUMS: RNGestureHandler: 9b113eb9b7a4cbe66e1dbf4d9914281863ee0703 RNKeychain: bfe3d12bf4620fe488771c414530bf16e88f3678 RNLocalize: dbea38dcb344bf80ff18a1757b1becf11f70cae4 - RNPermissions: 2c0eec471f4de66d04d226c339898d10a6e123c4 + RNPermissions: 8e5f8de95db3a4345df798a41c3633dc93143207 RNQrGenerator: 1676221c08bfabec978242989c733810dad20959 RNQuickAction: 6d404a869dc872cde841ad3147416a670d13fa93 RNReactNativeHapticFeedback: ec56a5f81c3941206fd85625fa669ffc7b4545f9 @@ -1865,6 +1868,7 @@ SPEC CHECKSUMS: SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d sodium-react-native-direct: 6bc246dbb4ec7c28093675e98b2846ce667f739d SSZipArchive: fe6a26b2a54d5a0890f2567b5cc6de5caa600aef + VisionCamera: 5055ba97cbfcbb988d982a2a8c474b1331b22476 Yoga: 04f1db30bb810187397fa4c37dd1868a27af229c ZXingObjC: 8898711ab495761b2dbbdec76d90164a6d7e14c5 diff --git a/ios/bitkit.xcodeproj/project.pbxproj b/ios/bitkit.xcodeproj/project.pbxproj index 2b27cc36d..cf27f1efa 100644 --- a/ios/bitkit.xcodeproj/project.pbxproj +++ b/ios/bitkit.xcodeproj/project.pbxproj @@ -8,11 +8,12 @@ /* Begin PBXBuildFile section */ 00E356F31AD99517003FC87E /* bitkitTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* bitkitTests.m */; }; + 0C03405D0C928E25030A6E5D /* libPods-bitkit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E086BFC61E246650E1BA177F /* libPods-bitkit.a */; }; 13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; - 14C7F078B9ECCF6D5CE4E4E0 /* libPods-bitkit-bitkitTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 82BD64DFFBDCF84B062DF0EC /* libPods-bitkit-bitkitTests.a */; }; 17074219BB5847259EAFC7A6 /* InterTight-Black.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 3815D562618543E7A9BC191E /* InterTight-Black.ttf */; }; + 465331242EE344ED5BFC3261 /* libPods-bitkit-bitkitTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7028208363C61C5772684918 /* libPods-bitkit-bitkitTests.a */; }; 57072143CA0F49089AE64F61 /* InterTight-ExtraBold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = A223BA795CEB4CB2B344FBAF /* InterTight-ExtraBold.ttf */; }; 6980B602E6DC4429841BE5EE /* InterTight-Medium.ttf in Resources */ = {isa = PBXBuildFile; fileRef = D67AECF5F543462F90EC89AD /* InterTight-Medium.ttf */; }; 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; @@ -20,7 +21,6 @@ 925570EA7B1D43CC8AD07B91 /* InterTight-Bold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = CA37793F82F144678099A00D /* InterTight-Bold.ttf */; }; 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 */; }; - C3D28AA3BD0927627BB234A5 /* libPods-bitkit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 31EFC5E3853CF2172202D5AF /* libPods-bitkit.a */; }; E2F35FC226645CE623C61C03 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 919FE2A2B4A7605C9F606896 /* PrivacyInfo.xcprivacy */; }; /* End PBXBuildFile section */ @@ -38,7 +38,6 @@ 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 = ""; }; - 0D94393DE57BB1237C3FD9BE /* 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 = ""; }; 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 = ""; }; @@ -46,20 +45,21 @@ 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 = ""; }; 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = PrivacyInfo.xcprivacy; path = bitkit/PrivacyInfo.xcprivacy; sourceTree = ""; }; - 31EFC5E3853CF2172202D5AF /* libPods-bitkit.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-bitkit.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 18AB2448970ECFDD296BD328 /* 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 = ""; }; + 1E38E605816A9B304910A5F3 /* 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 = ""; }; 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 = ""; }; - 3C7EE2A2C59CB47BD0CFDF03 /* 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 = ""; }; 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 = ""; }; + 7028208363C61C5772684918 /* libPods-bitkit-bitkitTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-bitkit-bitkitTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 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 = ""; }; + 7D29226527EC2AD1700C5A5E /* 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 = ""; }; 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = bitkit/LaunchScreen.storyboard; sourceTree = ""; }; - 82BD64DFFBDCF84B062DF0EC /* libPods-bitkit-bitkitTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-bitkit-bitkitTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 919FE2A2B4A7605C9F606896 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; name = PrivacyInfo.xcprivacy; path = bitkit/PrivacyInfo.xcprivacy; sourceTree = ""; }; 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 = ""; }; - A6510D324303D635A9F57BFF /* 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 = ""; }; - B36A867933B4B5BFDDE63376 /* 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 = ""; }; + BEE0F28BC305188C91E3D88A /* 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 = ""; }; 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 = ""; }; 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 = ""; }; + E086BFC61E246650E1BA177F /* libPods-bitkit.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-bitkit.a"; sourceTree = BUILT_PRODUCTS_DIR; }; ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; /* End PBXFileReference section */ @@ -68,7 +68,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 14C7F078B9ECCF6D5CE4E4E0 /* libPods-bitkit-bitkitTests.a in Frameworks */, + 465331242EE344ED5BFC3261 /* libPods-bitkit-bitkitTests.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -76,7 +76,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - C3D28AA3BD0927627BB234A5 /* libPods-bitkit.a in Frameworks */, + 0C03405D0C928E25030A6E5D /* libPods-bitkit.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -119,8 +119,8 @@ isa = PBXGroup; children = ( ED297162215061F000B7C4FE /* JavaScriptCore.framework */, - 31EFC5E3853CF2172202D5AF /* libPods-bitkit.a */, - 82BD64DFFBDCF84B062DF0EC /* libPods-bitkit-bitkitTests.a */, + E086BFC61E246650E1BA177F /* libPods-bitkit.a */, + 7028208363C61C5772684918 /* libPods-bitkit-bitkitTests.a */, ); name = Frameworks; sourceTree = ""; @@ -183,10 +183,10 @@ BBD78D7AC51CEA395F1C20DB /* Pods */ = { isa = PBXGroup; children = ( - B36A867933B4B5BFDDE63376 /* Pods-bitkit.debug.xcconfig */, - 0D94393DE57BB1237C3FD9BE /* Pods-bitkit.release.xcconfig */, - A6510D324303D635A9F57BFF /* Pods-bitkit-bitkitTests.debug.xcconfig */, - 3C7EE2A2C59CB47BD0CFDF03 /* Pods-bitkit-bitkitTests.release.xcconfig */, + BEE0F28BC305188C91E3D88A /* Pods-bitkit.debug.xcconfig */, + 18AB2448970ECFDD296BD328 /* Pods-bitkit.release.xcconfig */, + 7D29226527EC2AD1700C5A5E /* Pods-bitkit-bitkitTests.debug.xcconfig */, + 1E38E605816A9B304910A5F3 /* Pods-bitkit-bitkitTests.release.xcconfig */, ); path = Pods; sourceTree = ""; @@ -198,12 +198,12 @@ isa = PBXNativeTarget; buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "bitkitTests" */; buildPhases = ( - F76659A78AB8E8DAA61875BE /* [CP] Check Pods Manifest.lock */, + D36A8642A998B2DD09F32BA3 /* [CP] Check Pods Manifest.lock */, 00E356EA1AD99517003FC87E /* Sources */, 00E356EB1AD99517003FC87E /* Frameworks */, 00E356EC1AD99517003FC87E /* Resources */, - 31478B03316028D9FF020593 /* [CP] Embed Pods Frameworks */, - F9BB96CEF297605062F4B855 /* [CP] Copy Pods Resources */, + 3366CDB1AF1B4DD8B254D517 /* [CP] Embed Pods Frameworks */, + 3F325BCBCFFA1A7E6ABB4D8C /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -219,13 +219,13 @@ isa = PBXNativeTarget; buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "bitkit" */; buildPhases = ( - B09B508614A1A13173DEE197 /* [CP] Check Pods Manifest.lock */, + 93ADB158704BF4592FC9C698 /* [CP] Check Pods Manifest.lock */, 13B07F871A680F5B00A75B9A /* Sources */, 13B07F8C1A680F5B00A75B9A /* Frameworks */, 13B07F8E1A680F5B00A75B9A /* Resources */, 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, - 1749EECDE3672B535836D668 /* [CP] Embed Pods Frameworks */, - A7512337D4002772672A9C9F /* [CP] Copy Pods Resources */, + 289199CA30C8C2275E26EDB0 /* [CP] Embed Pods Frameworks */, + 5F3CF507F9F7AE16F7CD54D9 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -316,7 +316,7 @@ shellPath = /bin/sh; shellScript = "set -e\n\nWITH_ENVIRONMENT=\"$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"$REACT_NATIVE_PATH/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n"; }; - 1749EECDE3672B535836D668 /* [CP] Embed Pods Frameworks */ = { + 289199CA30C8C2275E26EDB0 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -333,7 +333,7 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-bitkit/Pods-bitkit-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - 31478B03316028D9FF020593 /* [CP] Embed Pods Frameworks */ = { + 3366CDB1AF1B4DD8B254D517 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -350,7 +350,24 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-bitkit-bitkitTests/Pods-bitkit-bitkitTests-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - A7512337D4002772672A9C9F /* [CP] Copy Pods Resources */ = { + 3F325BCBCFFA1A7E6ABB4D8C /* [CP] Copy Pods Resources */ = { + 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"; + outputFileListPaths = ( + "${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-bitkitTests/Pods-bitkit-bitkitTests-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + 5F3CF507F9F7AE16F7CD54D9 /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -367,7 +384,7 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-bitkit/Pods-bitkit-resources.sh\"\n"; showEnvVarsInLog = 0; }; - B09B508614A1A13173DEE197 /* [CP] Check Pods Manifest.lock */ = { + 93ADB158704BF4592FC9C698 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -389,7 +406,7 @@ 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; }; - F76659A78AB8E8DAA61875BE /* [CP] Check Pods Manifest.lock */ = { + D36A8642A998B2DD09F32BA3 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -411,23 +428,6 @@ 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; }; - F9BB96CEF297605062F4B855 /* [CP] Copy Pods Resources */ = { - 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"; - outputFileListPaths = ( - "${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-bitkitTests/Pods-bitkit-bitkitTests-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -461,7 +461,7 @@ /* Begin XCBuildConfiguration section */ 00E356F61AD99517003FC87E /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = A6510D324303D635A9F57BFF /* Pods-bitkit-bitkitTests.debug.xcconfig */; + baseConfigurationReference = 7D29226527EC2AD1700C5A5E /* Pods-bitkit-bitkitTests.debug.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; BUNDLE_LOADER = "$(TEST_HOST)"; @@ -489,7 +489,7 @@ }; 00E356F71AD99517003FC87E /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 3C7EE2A2C59CB47BD0CFDF03 /* Pods-bitkit-bitkitTests.release.xcconfig */; + baseConfigurationReference = 1E38E605816A9B304910A5F3 /* Pods-bitkit-bitkitTests.release.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; BUNDLE_LOADER = "$(TEST_HOST)"; @@ -514,7 +514,7 @@ }; 13B07F941A680F5B00A75B9A /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = B36A867933B4B5BFDDE63376 /* Pods-bitkit.debug.xcconfig */; + baseConfigurationReference = BEE0F28BC305188C91E3D88A /* Pods-bitkit.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIconOrange; ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES; @@ -546,7 +546,7 @@ }; 13B07F951A680F5B00A75B9A /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 0D94393DE57BB1237C3FD9BE /* Pods-bitkit.release.xcconfig */; + baseConfigurationReference = 18AB2448970ECFDD296BD328 /* 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 2281708ef..d196a5c64 100644 --- a/package.json +++ b/package.json @@ -87,7 +87,6 @@ "react-native": "0.74.3", "react-native-address-generator": "0.3.3", "react-native-biometrics": "3.0.1", - "react-native-camera-kit": "14.0.0-beta15", "react-native-device-info": "11.1.0", "react-native-dotenv": "3.4.11", "react-native-draggable-flatlist": "4.0.1", @@ -102,7 +101,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", @@ -118,6 +117,7 @@ "react-native-svg": "15.2.0", "react-native-tcp-socket": "6.0.6", "react-native-toast-message": "2.2.0", + "react-native-vision-camera": "4.4.3", "react-native-zip-archive": "6.1.0", "react-redux": "9.1.1", "readable-stream": "4.5.2", 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 f9b597a95..2c0caf293 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6433,7 +6433,6 @@ __metadata: react-native-address-generator: 0.3.3 react-native-biometrics: 3.0.1 react-native-bundle-visualizer: ^3.1.3 - react-native-camera-kit: 14.0.0-beta15 react-native-device-info: 11.1.0 react-native-dotenv: 3.4.11 react-native-draggable-flatlist: 4.0.1 @@ -6448,7 +6447,7 @@ __metadata: 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 @@ -6466,6 +6465,7 @@ __metadata: react-native-svg-transformer: ^1.3.0 react-native-tcp-socket: 6.0.6 react-native-toast-message: 2.2.0 + react-native-vision-camera: 4.4.3 react-native-zip-archive: 6.1.0 react-redux: 9.1.1 reactotron-react-native: ^5.1.6 @@ -14035,16 +14035,6 @@ __metadata: languageName: node linkType: hard -"react-native-camera-kit@npm:14.0.0-beta15": - version: 14.0.0-beta15 - resolution: "react-native-camera-kit@npm:14.0.0-beta15" - peerDependencies: - react: "*" - react-native: "*" - checksum: 6867d00df53dec159c48898a657628819cd637e7083b20f1ed5b6b93aafff01899642d8a99752faf2cef7b713e0f330327d8c38ca22aabb73c80ce1b42fcead3 - languageName: node - linkType: hard - "react-native-device-info@npm:11.1.0": version: 11.1.0 resolution: "react-native-device-info@npm:11.1.0" @@ -14210,17 +14200,17 @@ __metadata: languageName: node linkType: hard -"react-native-permissions@npm:3.10.1": - version: 3.10.1 - resolution: "react-native-permissions@npm:3.10.1" +"react-native-permissions@npm:4.1.5": + version: 4.1.5 + resolution: "react-native-permissions@npm:4.1.5" peerDependencies: - react: ">=16.13.1" - react-native: ">=0.63.3" - react-native-windows: ">=0.62.0" + react: ">=18.1.0" + react-native: ">=0.70.0" + react-native-windows: ">=0.70.0" peerDependenciesMeta: react-native-windows: optional: true - checksum: 86ea43e34f41a77d85c1af2c4a4ff241dd7cb08a3f62a2ba6c8b8bbb8b03cdf4452609cd388ff7b3785086ad3ce95d45c5e6feca1af3ea2a544aafcfec28d0e1 + checksum: dc4b366a0f561a47f032c027eb703a2be45e801788b915ed583e38f617eea23656eb63a77b17fb3a663fe3199b2ec25788f799e751421634e35a64f5258feed9 languageName: node linkType: hard @@ -14435,6 +14425,26 @@ __metadata: languageName: node linkType: hard +"react-native-vision-camera@npm:4.4.3": + version: 4.4.3 + resolution: "react-native-vision-camera@npm:4.4.3" + peerDependencies: + "@shopify/react-native-skia": "*" + react: "*" + react-native: "*" + react-native-reanimated: "*" + react-native-worklets-core: "*" + peerDependenciesMeta: + "@shopify/react-native-skia": + optional: true + react-native-reanimated: + optional: true + react-native-worklets-core: + optional: true + checksum: 0934fa5d4f317aab7d11127551fd55142bb9700747a35ceb32d4f1341ab58726e4782ce1aa2396f2e9c71e9842f99ae5c02029d931811b1f07d425bb4e9171b6 + languageName: node + linkType: hard + "react-native-zip-archive@npm:6.1.0": version: 6.1.0 resolution: "react-native-zip-archive@npm:6.1.0"