contfedorov opened a new issue, #1593:
URL: https://github.com/apache/cordova-ios/issues/1593
# Bug Report
## Problem
I need to set device interface orientation to be the following:
- iPhones: portrait only
- iPads: landscape only
I add the following to `config.xml` in order to update `Info.plist`:
```xml
<platform name="ios">
<config-file target="*-Info.plist"
parent="UISupportedInterfaceOrientations">
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
</config-file>
<config-file target="*-Info.plist"
parent="UISupportedInterfaceOrientations~ipad">
<array>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</config-file>
</platform>
```
`App-Info.plist` is generated correctly, interface-related options are
included. Nevertheless, UI rotates according to emulator rotation.
### What is expected to happen?
App orientation is fixed according to my requirements: portrait only for
phones, landscape only for tablets.
### What does actually happen?
App orientation does not depend on `config.xml` settings.
## Information
<!-- Include all relevant information that might help understand and
reproduce the problem -->
- It used to work in `cordova-ios` 7.1.1
- It can be reproduced by creating empty Cordova project (`cordova create
MyApp`) and updating `config.xml` accordingly.
- Generated XCode project (`platforms/ios/App.xcodeproj/project.pbxproj`)
contains lined related to interface orientation. These lines override
`Info.plist` configuration. It can be changed in UI, but it is not an
acceptable solution.
<img width="1303" height="761" alt="Image"
src="https://github.com/user-attachments/assets/e3e77b02-706f-4197-a8a3-bf183e4e7d42"
/>
Lines in project template:
https://github.com/apache/cordova-ios/blob/5d98b865a0619ca64d0101dc2b0484ad7294be22/templates/project/App.xcodeproj/project.pbxproj#L444-L445
https://github.com/apache/cordova-ios/blob/5d98b865a0619ca64d0101dc2b0484ad7294be22/templates/project/App.xcodeproj/project.pbxproj#L482-L483
### Command or Code
<!-- What command or code is needed to reproduce the problem? -->
### Environment, Platform, Device
<!-- In what environment, on what platform or on which device are you
experiencing the issue? -->
macOS 15.7.2
iPhone simulator w/ iOS 17.2, 18.4
### Version information
<!--
What are relevant versions you are using?
For example:
Cordova: Cordova CLI, Cordova Platforms, Cordova Plugins
Other Frameworks: Ionic Framework and CLI version
Operating System, Android Studio, Xcode etc.
-->
Cordova CLI 13.0.0
`cordova-ios` 8.0.0
no plugins
XCode 16.3
## Checklist
<!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
- [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
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]