ios – Detecting (and selecting) the Macro (Ultra-Wide?) Camera on iPhone 13(Pro) and later


I have found several questions (and a few answers) of how to enable the Macro camera feature of the iPhone 13(Pro) and later, but none in Delphi. It seems like TCamera only exposes access to either “Back”, “Default” or “Front” camera, and is unable to select (automatically or otherwise) the close-up Macro/Ultra-Wide camera.

I have tried with both TCameraKind.Default and TCameraKind.BackCamera and with both TFocusMode.ContinousAutoFocus and TFocusMode.AutoFocus and none of these combinations will result in the camera being able to focus on close-ups (I am trying to scan a bar code, so the phone needs to be pretty close to the item I’m scanning). It works perfectly well in 2-camera phones with BackCamera/ContinousAutoFocus, but this combination (or any other) doesn’t work on 3-camera phones (tested with iPhone 15 Pro).

Has anyone made a Delphi code that switches to the Macro camera (if it’s there). I don’t mind some conditional {$IFDEF iOS } code if that’s what it takes, but I am not at all knowledgeable in Apple’s native API, so I am unable to do it myself.

A possible solution (but not in Delphi) can be found here: searching for reliable way to select iPhone 13 macro camera device

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img