apache / apache/cordova-plugin-camera

Using the getPicture causes app orientation to change even if it is locked

Open
#427 1 comment 3 reactions 0 assignees View on GitHub
Dominant language
Objective-C
Stars
976
Forks
1.6k
PR merge metrics
No merged PRs in 30d

Description

# Bug Report
I have an app that is locked to landscape (the config.xml Orientation preference is set to landscape)
When taking a photo using getPicture it all works great. But if the camera enters portrait mode, when I return to the app the orientation of the app has also changed to portrait mode. This is locked and there seems to be no way to return the orientation.

### What is expected to happen?

Orientation of the app in config.xml should be respected and not change at all when using getPicture.

### What does actually happen?

Orientation of app changes from landscape to portrait.

### Command or Code
1 - Ensure cordova app orientation preference is set to landscape in config.xml.
2 - Call `navigator.camera.getPicture(()=>{})`
3 - Ensure that device is rotated to portrait mode whilst taking picture
4 - Take picture
5 - Observe the app is now in portrait mode

### Environment, Platform, Device
IOS Cordova engine: v4.5.5
Cordova: v8.1.1
Plugin: v4.0.3
IOS version: 12.1.4
Device: iPhoneX

### Version information
Xcode

## Checklist

- [x] I searched for existing GitHub issues
- [x] I updated all Cordova tooling to most recent version
- [x] I included all the necessary information above

If theres any more info required let me know and I will be happy to help!

Cheers!

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the landscape-locked app scenario with navigator.camera.getPicture on the iOS plugin path, rotating the device while the camera is active. Trace how camera dismissal restores app orientation; done means the config.xml landscape preference remains respected after returning from a portrait camera session.

Written by the indexing model from the issue text.

Assessment

Tech stack
objective-c
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.