Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
a2fdfbf
feat: support react-native-vision-camera v3
rkmackinnon Mar 28, 2023
6697b63
fix: add missing dependency on VisionCamera
rkmackinnon Apr 25, 2023
4dcfeab
Fix build with use_frameworks! :linkage => :static
rkmackinnon Apr 26, 2023
57cc338
Update Pods to recommended settings for XCode 14.3
rkmackinnon Apr 26, 2023
5d37292
Register plugins outside of AppDelegate, easier to use with Expo
AnomalousLLC May 9, 2023
918c201
Make sure Swift interface header is included when built statically
AnomalousLLC May 19, 2023
bc64524
Conditional import of Swift interface header
AnomalousLLC May 19, 2023
4ad35aa
Merge pull request #1 from AnomalousLLC/react-native-vision-camera-v3
rkmackinnon May 19, 2023
5738c15
Update VisionCameraCodeScanner.podspec
rkmackinnon May 19, 2023
dde6fec
Update AppDelegate.m
rkmackinnon May 19, 2023
01e5121
Fix hook & corresponding documentation
AnomalousLLC May 19, 2023
8196712
Recreate the types array
AnomalousLLC May 20, 2023
a4a96a5
Cleaner, ensures types is an array
AnomalousLLC May 20, 2023
187bc37
Merge pull request #2 from AnomalousLLC/react-native-vision-camera-v3…
rkmackinnon May 24, 2023
1202057
Update example app to use hook
rkmackinnon May 24, 2023
299180b
fix/remove-skia-workaround
rkmackinnon May 24, 2023
4fa6e09
fix/adjust-pathing
rkmackinnon May 30, 2023
5d522eb
fix/android-jni-error
rkmackinnon May 30, 2023
93ac09a
Update Android example app for newer react version
rkmackinnon May 30, 2023
7b980af
fix/update-react-native-worklets src/types pathing
rkmackinnon May 30, 2023
dedefa6
Add comment to hook.tsx
rkmackinnon May 30, 2023
f2933a7
add support for v3.0.0 for iOS
rkmackinnon Sep 2, 2023
17f2264
android fixes
rkmackinnon Sep 16, 2023
97ddfc8
add support for v3.1.0 for iOS
rkmackinnon Sep 28, 2023
06e77d2
more incomplete android fixes
rkmackinnon Sep 29, 2023
9873cb3
iOS AND Android working with v3.2.2
rkmackinnon Sep 30, 2023
415cd8e
fix bug with react-native-static-safe-area-insets
rkmackinnon Oct 3, 2023
e4d15c7
bump react-native-worklets-core version
rkmackinnon Oct 3, 2023
6448f95
update example app tsconfig to not extend root
rkmackinnon Oct 3, 2023
d56f00f
fix: managed to compile
ismaelsousa Oct 11, 2023
0251b82
Update react-native-vision-camera to version 4.0.1
ismaelsousa Apr 22, 2024
c4ffe10
Update version to 3.0.0 in package.json
ismaelsousa Apr 22, 2024
202e0ef
Update react-native-vision-camera to version 4.0.1
ismaelsousa Apr 23, 2024
0525310
Update README.md with information about using vision camera v4
ismaelsousa Apr 23, 2024
20c7b6f
chore: update repository and author information in package.json
ismaelsousa May 13, 2024
faa9074
fix types
ismaelsousa May 13, 2024
8c23144
chore: release 3.0.1
ismaelsousa May 13, 2024
04cc443
chore: Update package.json with new package name and access level
ismaelsousa May 13, 2024
13740ad
chore: Add "publish" script to package.json for preparing and releasi…
ismaelsousa May 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,20 @@ node_modules/
npm-debug.log
yarn-debug.log
yarn-error.log
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
example/.pnp/*
example/.yarn/*
!example/.yarn/patches
!example/.yarn/plugins
!example/.yarn/releases
!example/.yarn/sdks
!example/.yarn/versions

# BUCK
buck-out/
Expand Down
873 changes: 873 additions & 0 deletions .yarn/releases/yarn-3.5.0.cjs

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-3.5.0.cjs
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# vision-camera-code-scanner

## using vision camera v4

VisionCamera Frame Processor Plugin to read barcodes using MLKit Vision Barcode Scanning

## Installation
Expand All @@ -8,21 +10,16 @@ VisionCamera Frame Processor Plugin to read barcodes using MLKit Vision Barcode
yarn add vision-camera-code-scanner
```

make sure you correctly [setup](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation/) react-native-reanimated and insert as a first line of your [`index.tsx`](https://github.com/rodgomesc/vision-camera-code-scanner/blob/1409a8afd02328a26e336036493b2d6ef8441359/example/index.tsx#L1)
make sure you correctly [setup](https://github.com/chrfalch/react-native-worklets) react-native-worklets and insert as a first line of your [`index.tsx`](https://github.com/rodgomesc/vision-camera-code-scanner/blob/1409a8afd02328a26e336036493b2d6ef8441359/example/index.tsx#L1)

```sh
import 'react-native-reanimated'
import "react-native-worklets/src";
```

Add this to your `babel.config.js`

```
[
'react-native-reanimated/plugin',
{
globals: ['__scanCodes'],
},
]
["react-native-worklets/plugin"],
```

## Usage
Expand Down Expand Up @@ -50,10 +47,15 @@ export default function App() {

// Alternatively you can use the underlying function:
//
// const [barcodes, setBarcodes] = React.useState<Barcode[]>([]);
// const setBarcodesJS = Worklets.createRunInJsFn(setBarcodes);
//
// const frameProcessor = useFrameProcessor((frame) => {
// 'worklet';
// const detectedBarcodes = scanBarcodes(frame, [BarcodeFormat.QR_CODE], { checkInverted: true });
// runOnJS(setBarcodes)(detectedBarcodes);
// const detectedBarcodes = scanBarcodes(frame, [BarcodeFormat.ALL_FORMATS], {
// checkInverted: true,
// });
// setBarcodesJS(detectedBarcodes);
// }, []);

React.useEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@ require "json"
package = JSON.parse(File.read(File.join(__dir__, "package.json")))

Pod::Spec.new do |s|
s.name = "vision-camera-code-scanner"
s.name = "VisionCameraCodeScanner"
s.version = package["version"]
s.summary = package["description"]
s.homepage = package["homepage"]
s.license = package["license"]
s.authors = package["author"]

s.platforms = { :ios => "11.0" }
s.platforms = { :ios => "12.4" }
s.source = { :git => "https://github.com/rodgomesc/vision-camera-code-scanner.git", :tag => "#{s.version}" }

s.source_files = "ios/**/*.{h,m,mm,swift}"

s.dependency "React-Core"
s.dependency "GoogleMLKit/BarcodeScanning"
s.dependency "VisionCamera"
end
12 changes: 6 additions & 6 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:4.2.1'
classpath 'com.android.tools.build:gradle:7.3.1'
}
}
}
Expand All @@ -18,11 +18,11 @@ def safeExtGet(prop, fallback) {
}

android {
compileSdkVersion safeExtGet('VisionCameraCodeScanner_compileSdkVersion', 30)
compileSdkVersion safeExtGet('VisionCameraCodeScanner_compileSdkVersion', 33)
ndkVersion "21.4.7075529"
defaultConfig {
minSdkVersion safeExtGet('VisionCameraCodeScanner_minSdkVersion', 21)
targetSdkVersion safeExtGet('VisionCameraCodeScanner_targetSdkVersion', 31)
minSdkVersion safeExtGet('VisionCameraCodeScanner_minSdkVersion', 26)
targetSdkVersion safeExtGet('VisionCameraCodeScanner_targetSdkVersion', 33)
versionCode 1
versionName "1.0"

Expand Down Expand Up @@ -55,7 +55,7 @@ repositories {
dependencies {
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+" // From node_modules
api project(":react-native-vision-camera")
implementation project(':react-native-vision-camera')
implementation "androidx.camera:camera-core:1.1.0-alpha06"
implementation 'com.google.mlkit:barcode-scanning:17.0.0'
implementation 'com.google.mlkit:barcode-scanning:17.2.0'
}
3 changes: 2 additions & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#Mon Apr 22 14:42:18 BRT 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading