Skip to content

v0.2.2 – Cross-Platform Polish

Choose a tag to compare

@Preeternal Preeternal released this 02 Oct 15:53
· 47 commits to master since this release

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])
}