Skip to content

πŸ› Camera cannot focus at close range (~10cm) on iPhone 18 Pro β€” works on iPhone 12 ProΒ #4194

Description

@klabusta

Prerequisites

Steps to reproduce

  1. Call useCameraDevice('back') on an iPhone 18 Pro
  2. Use the returned device in a <Camera> component (default config, no custom format/zoom)
  3. Hold a product label or barcode at ~10cm distance from the camera
  4. Observe that the image is blurry / out of focus β€” barcode scanning fails

What did you expect to happen?

The camera focuses sharply on a barcode/label at ~10cm distance, as it does on iPhone 12 Pro and older devices.

What actually happened?

The image stays blurry at ~10cm. The wide-angle camera on iPhone 18 Pro has a minimum focus distance of ~20cm due to its larger sensor, so anything closer is out of focus. The barcode scanner cannot decode the codes.

Moving the phone further away (~25cm+) brings the image into focus, but for our use case (scanning small product labels on automotive parts) this is too far β€” the codes are too small to fill enough of the frame.

Affected platforms

iOS (device)

Device(s) affected

iPhone 18 Pro (built with XCode 27 / iOS 27): broken β€” blurry at 10cm, iPhone 12 Pro (built with XCode 26 / iOS 27): works β€” sharp at 10cm

VisionCamera version

5.1.0

React Native version

0.84.1

React Native architecture

New Architecture (Fabric / bridgeless)

Features being used

  • Preview
  • Photo capture
  • Video capture
  • Frame Processors (worklets)
  • Skia Frame Processors
  • Code/Barcode Scanner
  • Location metadata
  • Multi-cam
  • Depth data
  • HDR / custom dynamic range
  • Custom format / FPS / resolution

Relevant logs / stack trace

Minimal reproduction component:

const device = useCameraDevice('back');

const scannerOutput = useBarcodeScannerOutput({
  barcodeFormats: ['code-128', 'ean-13', 'qr-code', 'data-matrix'],
  onBarcodeScanned: (barcodes) => { /* ... */ },
});

<Camera
  style={StyleSheet.absoluteFill}
  device={device}
  isActive={true}
  outputs={[scannerOutput]}
/>

No errors in the console. The camera opens and streams frames, but the
autofocus system never achieves sharp focus at distances below ~20cm on
iPhone 18 Pro. The same code focuses correctly on iPhone 12 Pro at the
same distance.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions