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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ android/keystores/debug.keystore
!.yarn/releases
!.yarn/sdks
!.yarn/versions
yarn.lock

# Expo
.expo/
Expand Down
15 changes: 8 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.1.0] - 2025-08-26
## [0.1.0] - 2025-08-27

### Added
- Initial release of React Native Image Code Scanner
- Native implementation for iOS using Vision Framework
- Native implementation for Android using ML Kit
- Support for 13 barcode formats (QR Code, Code 128, Code 39, etc.)
- Advanced image preprocessing options:
- **Automatic image preprocessing** for optimal recognition:
- Contrast enhancement
- Grayscale conversion
- Automatic rotation attempts
- Platform-specific preprocessing overrides
- Multiple rotation attempts (0Β°, 90Β°, 180Β°, 270Β°)
- **Ultra-simple API** - just pass image path and formats, preprocessing is always automatic
- Full support for React Native's New Architecture (Turbo Modules)
- TypeScript support with complete type definitions
- Comprehensive documentation and examples
Expand All @@ -28,18 +28,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Features
- Lightweight and performant native implementation
- Smart retry logic with image preprocessing
- **Automatic preprocessing** enabled by default for best results
- Smart retry logic with multiple image enhancement techniques
- No additional setup required for Android
- Minimal iOS setup with just pod install
- **Expo integration** with proper prebuild workflow
- **Modern example app** using Expo Image Picker and StatusBar
- **Real-time configuration** of preprocessing options
- **Simplified API** - just pass image path and formats
- **Performance metrics** and timing measurements

### Example App Features
- Modern Expo-based example application
- Barcode format selection UI with real-time toggles
- Enhanced preprocessing options with visual controls
- Automatic preprocessing info with optional disable switch
- Improved error handling and user feedback
- Comprehensive setup documentation
- Support for both Expo Go (UI testing) and prebuild (full functionality)
Expand Down
206 changes: 206 additions & 0 deletions COMPATIBILITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
# React Native Image Code Scanner - Compatibility Guide

## Version Compatibility Matrix

### React Native Versions

| React Native | Package Version | Architecture Support | Notes |
|-------------|-----------------|---------------------|--------|
| 0.70.x | βœ… 0.1.x | Old Architecture | Full support |
| 0.71.x | βœ… 0.1.x | Old Architecture | Full support |
| 0.72.x | βœ… 0.1.x | Old Architecture | Full support |
| 0.73.x | βœ… 0.1.x | Old & New Architecture | Full support |
| 0.74.x | βœ… 0.1.x | Old & New Architecture | Full support |
| 0.75.x | βœ… 0.1.x | Old & New Architecture | Full support |
| 0.76.x | βœ… 0.1.x | New Architecture (default) | Full support |
| 0.77.x | βœ… 0.1.x | New Architecture (default) | Full support |
| 0.78.x | βœ… 0.1.x | New Architecture (default) | Full support |
| **0.79.x** | βœ… **0.1.x** | **New Architecture (default)** | **Latest - Full support** |
| 0.80.x+ | πŸ”œ 0.1.x | New Architecture | Ready when released |

### React Versions

| React Version | Compatibility |
|--------------|---------------|
| 17.x | βœ… Supported |
| 18.x | βœ… Supported (Recommended) |
| 19.x | βœ… Supported (Beta) |

### Expo SDK Compatibility

| Expo SDK | React Native | Package Version | Status |
|----------|-------------|-----------------|--------|
| SDK 49 | 0.72.x | βœ… 0.1.x | Supported (requires prebuild) |
| SDK 50 | 0.73.x | βœ… 0.1.x | Supported (requires prebuild) |
| SDK 51 | 0.74.x | βœ… 0.1.x | Supported (requires prebuild) |
| **SDK 52** | **0.79.x** | βœ… **0.1.x** | **Latest - Full support (requires prebuild)** |

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

## Platform Requirements

### iOS Requirements

- **Minimum iOS Version**: 13.4
- **Xcode**: 14.0 or higher
- **Swift**: 5.0 or higher
- **Frameworks Required**:
- Vision Framework (iOS 11+)
- Core Image (iOS 5+)
- UIKit (iOS 2+)
- Core Graphics (iOS 2+)

### Android Requirements

- **Minimum SDK**: 21 (Android 5.0 Lollipop)
- **Target SDK**: 33+ (Android 13+)
- **Compile SDK**: 33+
- **Kotlin**: 1.6.0+
- **Gradle**: 7.0+
- **Android Gradle Plugin**: 7.0+
- **Dependencies**:
- Google ML Kit Barcode Scanning: 17.3.0+
- AndroidX Camera Core: 1.3.1+

### Node.js Requirements

- **Node.js**: >=18.0.0 (LTS recommended)
- **npm**: >=8.0.0
- **Yarn**: >=1.22.0 or >=3.0.0 (Berry)

## New Architecture Support

### Turbo Modules (React Native 0.68+)

This library is built as a Turbo Module and fully supports the New Architecture:

```typescript
// Automatically uses Turbo Module when New Architecture is enabled
import ImageCodeScanner from 'react-native-image-code-scanner';
```

### Fabric (React Native 0.68+)

The library is compatible with Fabric renderer but doesn't include UI components, so Fabric configuration is not required.

### Enabling New Architecture

#### For React Native 0.70-0.75

```bash
# iOS
cd ios && RCT_NEW_ARCH_ENABLED=1 pod install

# Android - in gradle.properties
newArchEnabled=true
```

#### For React Native 0.76+

New Architecture is enabled by default. To disable:

```bash
# iOS
cd ios && RCT_NEW_ARCH_ENABLED=0 pod install

# Android - in gradle.properties
newArchEnabled=false
```

## Migration Guide

### From React Native 0.6x to 0.7x

If you're upgrading from React Native 0.6x:

1. Update peer dependencies:
```json
{
"react": ">=17.0.0",
"react-native": ">=0.70.0"
}
```

2. Update iOS deployment target to 13.4 or higher

3. Update Android minSdkVersion to 21 or higher

### From Old to New Architecture

No code changes required! The library automatically detects and uses the appropriate architecture:

```typescript
// Same API for both architectures
const results = await ImageCodeScanner.scan({
path: imagePath,
formats: [BarcodeFormat.QR_CODE]
});
```

## Testing Compatibility

### Test Matrix

Run tests across different React Native versions:

```bash
# Test with specific React Native version
npx react-native init TestApp --version 0.79.2
cd TestApp
npm install react-native-image-code-scanner
```

### Automated Testing

The library is tested against:
- React Native 0.70.x (Old Architecture)
- React Native 0.75.x (Both Architectures)
- React Native 0.79.x (New Architecture)
- Latest React Native release

## Known Issues and Workarounds

### Issue: Build fails on React Native 0.70.x with New Architecture

**Solution**: New Architecture requires React Native 0.68+. For 0.70.x, ensure Old Architecture is used.

### Issue: Expo Go doesn't work

**Solution**: This is expected. The library uses native modules that require prebuild:
```bash
npx expo prebuild
npx expo run:ios # or run:android
```

### Issue: TypeScript errors with React Native 0.7x

**Solution**: Ensure you have the correct @types/react-native:
```bash
npm install --save-dev @types/react@^18.0.0 @types/react-native@^0.72.0
```

## Support Policy

- **Active Support**: Latest 3 minor versions of React Native
- **Security Updates**: Latest 6 minor versions of React Native
- **Best Effort**: Older versions on case-by-case basis

## Reporting Compatibility Issues

If you encounter compatibility issues:

1. Check this compatibility guide
2. Search [existing issues](https://github.com/nguyenthanhan/react-native-image-code-scanner/issues)
3. Create a new issue with:
- React Native version
- Package version
- Platform (iOS/Android)
- Architecture (Old/New)
- Error messages/logs

## Resources

- [React Native Releases](https://github.com/facebook/react-native/releases)
- [React Native New Architecture](https://reactnative.dev/docs/new-architecture-intro)
- [Expo SDK Versions](https://docs.expo.dev/versions/latest/)
- [Package Changelog](./CHANGELOG.md)
Loading
Loading