Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
42 changes: 21 additions & 21 deletions COMPATIBILITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@

### React Native Versions

| React Native | Package Version | Architecture Support | Notes |
| ------------ | --------------- | ------------------------------ | ------------------------- |
| 0.70.x | ✅ 1.1.x | Old Architecture | Full support |
| 0.71.x | ✅ 1.1.x | Old Architecture | Full support |
| 0.72.x | ✅ 1.1.x | Old Architecture | Full support |
| 0.73.x | ✅ 1.1.x | Old & New Architecture | Full support |
| 0.74.x | ✅ 1.1.x | Old & New Architecture | Full support |
| 0.75.x | ✅ 1.1.x | Old & New Architecture | Full support |
| 0.76.x | ✅ 1.1.x | New Architecture (default) | Full support |
| 0.77.x | ✅ 1.1.x | New Architecture (default) | Full support |
| 0.78.x | ✅ 1.1.x | New Architecture (default) | Full support |
| **0.79.x** | ✅ **1.1.x** | **New Architecture (default)** | **Latest - Full support** |
| 0.80.x+ | 🔜 1.1.x | New Architecture | Ready when released |
| React Native | Package Version | Architecture Support | Notes |
| ------------ | --------------- | ------------------------------ | --------------------- |
| 0.70.x | ✅ 1.1.x | Old Architecture | Full support |
| 0.71.x | ✅ 1.1.x | Old Architecture | Full support |
| 0.72.x | ✅ 1.1.x | Old Architecture | Full support |
| 0.73.x | ✅ 1.1.x | Old & New Architecture | Full support |
| 0.74.x | ✅ 1.1.x | Old & New Architecture | Full support |
| 0.75.x | ✅ 1.1.x | Old & New Architecture | Full support |
| 0.76.x | ✅ 1.1.x | New Architecture (default) | Full support |
| 0.77.x | ✅ 1.1.x | New Architecture (default) | Full support |
| 0.78.x | ✅ 1.1.x | New Architecture (default) | Full support |
| **0.79.x** | ✅ **1.1.x** | **New Architecture (default)** | **Full support** |
| 0.80.x+ | 🔜 1.1.x | New Architecture | Compatibility pending |

### React Versions

Expand All @@ -28,12 +28,12 @@

### Expo SDK Compatibility

| Expo SDK | React Native | Package Version | Status |
| ---------- | ------------ | --------------- | --------------------------------------------- |
| SDK 49 | 0.72.x | ✅ 1.1.x | Supported (requires prebuild) |
| SDK 50 | 0.73.x | ✅ 1.1.x | Supported (requires prebuild) |
| SDK 51 | 0.74.x | ✅ 1.1.x | Supported (requires prebuild) |
| **SDK 52** | **0.79.x** | ✅ **1.1.x** | **Latest - Full support (requires prebuild)** |
| Expo SDK | React Native | Package Version | Status |
| ---------- | ------------ | --------------- | -------------------------------------------- |
| SDK 49 | 0.72.x | ✅ 1.1.x | Supported (requires prebuild) |
| SDK 50 | 0.73.x | ✅ 1.1.x | Supported (requires prebuild) |
| SDK 51 | 0.74.x | ✅ 1.1.x | Supported (requires prebuild) |
| **SDK 52** | **0.76.x** | ✅ **1.1.x** | **Example app baseline (requires prebuild)** |

**Note**: This library requires prebuild for Expo projects as it uses native modules.

Expand All @@ -53,8 +53,8 @@
### Android Requirements

- **Minimum SDK**: 21 (Android 5.0 Lollipop)
- **Target SDK**: 33+ (Android 13+)
- **Compile SDK**: 33+
- **Target SDK**: 34+ (Android 14+)
- **Compile SDK**: 35+
- **Kotlin**: 1.6.0+
- **Gradle**: 7.0+
- **Android Gradle Plugin**: 7.0+
Expand Down
54 changes: 51 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,15 @@ If your app picks images from camera, add to `Info.plist`:

## Usage

Works with any image picker — pass the local file URI to `scan()`:
Works with any image picker — pass the local image URI to `scan()`.
Android supports file paths, `file://` URIs, and `content://` URIs.
iOS supports file paths and `file://` URIs, including percent-encoded paths.

```ts
import * as ImagePicker from 'expo-image-picker';
import ImageCodeScanner, { BarcodeFormat } from 'react-native-image-code-scanner';
import ImageCodeScanner, {
BarcodeFormat,
} from 'react-native-image-code-scanner';

async function pickAndScan() {
const picked = await ImagePicker.launchImageLibraryAsync({
Expand Down Expand Up @@ -92,6 +96,9 @@ ImageCodeScanner.scan(options: ScanOptions): Promise<ScanResult[]>
interface ScanOptions {
path: string;
formats?: BarcodeFormat[]; // default: [QR_CODE]
enhanceContrast?: boolean; // default: true
convertToGrayscale?: boolean; // default: true
tryRotations?: boolean; // default: true
}

interface ScanResult {
Expand All @@ -104,7 +111,8 @@ interface ScanResult {

**Supported formats:** `QR_CODE`, `CODE_128`, `CODE_39`, `CODE_93`, `EAN_13`, `EAN_8`, `UPC_A`, `UPC_E`, `PDF_417`, `DATA_MATRIX`, `AZTEC`, `ITF`, `CODABAR`

Preprocessing runs automatically: original → grayscale → contrast enhancement → rotation retries.
Preprocessing runs automatically by default: original → grayscale → contrast enhancement → rotation retries.
Set `enhanceContrast`, `convertToGrayscale`, or `tryRotations` to `false` to skip those retry passes.

## Tips

Expand All @@ -123,6 +131,46 @@ Preprocessing runs automatically: original → grayscale → contrast enhancemen

See [example app](./example) and [example README](./example/README.md).

## Publishing to npm

1. Run checks:

```bash
yarn typecheck
yarn lint
yarn test
yarn build
```

2. Create a release:

```bash
yarn release
```

This bumps the version and creates a `vX.Y.Z` tag.

3. Push the release commit and tag:

```bash
git push && git push --tags
```

GitHub Actions publishes to npm automatically after CI passes for the release tag.

Verify the published version:

```bash
npm view react-native-image-code-scanner version
```

For a beta release:

```bash
yarn release:beta
git push && git push --tags
```

## Contributing

Please read [CONTRIBUTING.md](CONTRIBUTING.md).
Expand Down
2 changes: 1 addition & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ImageCodeScanner_kotlinVersion=2.0.21
ImageCodeScanner_minSdkVersion=24
ImageCodeScanner_minSdkVersion=21
ImageCodeScanner_targetSdkVersion=34
ImageCodeScanner_compileSdkVersion=35
ImageCodeScanner_ndkVersion=27.1.12297006
Loading
Loading