Skip to content

Releases: Preeternal/react-native-document-scanner-plugin

v0.2.2 – Cross-Platform Polish

02 Oct 15:53

Choose a tag to compare

Highlights

  • Ensure Google’s document scanner respects system bars on Android 15+ and restore window flags when returning to React Native (Fix #2).
  • Prevent repeated scans from crashing the Android bridge (ObjectAlreadyConsumedException) and validate returned URIs before resolving promises (Fix WebsiteBeaver#142).
  • Align Android/iOS responses: base64 conversion is guarded, file paths are checked for readability, and iOS trims/validates file:// URLs (Fix WebsiteBeaver#142).
  • Restore DocumentScanner Objective‑C bridge so both old and new architectures build cleanly without warnings.

Additional Notes

  • Covers testing on both architectures, with New Arch guarding the TurboModule entry point while legacy builds continue to use the classic bridge.
  • No API changes; consumers can upgrade directly.

Docs: Sanitized scanner response

  • Since v0.2.2 the module sanitizes scannedImages on both platforms. You no longer need to post‑filter in JS.
  • Android: returns only non‑empty base64 strings or readable URIs (verified via ContentResolver).
  • iOS: trims strings, normalizes file:// URLs to file paths and checks file existence.
  • Backward‑compatible; no API changes.

Example:

const { status, scannedImages } = await DocumentScanner.scanDocument({ responseType: 'imageFilePath' })
if (status === 'success' && scannedImages.length) {
  // All items are already valid
  setImage(scannedImages[0])
}

v0.2.1 – Expo EAS iOS Swift Header Fix

26 Aug 15:31

Choose a tag to compare

  • Fix: Reliable import of generated Swift header (DocumentScanner-Swift.h) using conditional __has_include + VisionKit import so Expo EAS cloud builds no longer fail with ‘DocumentScanner-Swift.h’ or VNDocumentCameraViewControllerDelegate not found.
  • Ensures consistent iOS 13+ VisionKit availability for Expo SDK 53 development & production builds.

v0.2.0 – TurboModule support & improvements

21 Aug 11:11

Choose a tag to compare

Added

  • Full support for React Native New Architecture (TurboModules).
  • Prepared builds with react-native-builder-bob.

Changed

  • Updated dependencies to React Native 0.79.2 and React 19.0.0.
  • Improved TypeScript definitions.

Fixed

  • Minor issues in Android and iOS build configurations.