Skip to content

Issue: [iOS] Camera preview rotated incorrectly in landscape-only Flutter app (SocketCam) #18

@CJblaze2022

Description

@CJblaze2022

Your Socket Mobile Developer ID

54e59106-0c49-ea11-a812-000d3a378c4b

Environment

  • OS version: iPadOS 26.2 (and other iPadOS versions reported by customers).
  • CaptureSDK version: 1.4.46 (reproducible up to the latest version, 1.5.60).
  • Device: iPad 9th generation (and other models reported by customers).

Description

When the app is set to landscape-only via Info.plist and the method to open the camera (SocketCam) is called, the camera UI displays correctly if the device is physically in landscape mode.

Image

However, if the user holds the device in portrait and opens the camera:

  • The camera video preview appears rotated by 90° (incorrect).
  • The scanning frame is stretched and does not match the orientation.
  • Native overlays (X button, label, flash icon) are correctly oriented in landscape.
Image

I also tried forcing orientation in AppDelegate, but it did not solve the issue. My original and current configuration only uses Info.plist for orientation.
I also tried forcing orientation in Flutter with SystemChrome.setPreferredOrientations and modifying methods in the plugin and native .m files, without success.
The issue only affects the camera video/canvas, not the overlays.

Steps to Reproduce

  1. Configure a Flutter app for iOS (iPad) to support only landscape orientation via Info.plist.
  2. Build and run the app on an iPad.
  3. Hold the device physically in portrait orientation.
  4. Call the method to open the camera (SocketCam).
  5. Observe the camera preview and scanning frame.

Expected Behavior

The camera video and scanning frame should always respect the app’s logical orientation (landscape), regardless of the device’s physical orientation.

Actual Behavior

  • The camera video preview appears rotated by 90° when the device is held in portrait.
  • The scanning frame is stretched and does not match the landscape orientation.
  • Native overlays remain correctly oriented in landscape.

Additional Context

  • The app is iPad-only and must work exclusively in landscape.
  • The issue only occurs on iOS. Android has not been tested, as our app only supports iOS at this time.

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