You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "MartinKei (via GitHub)" <gi...@apache.org> on 2026/10/18 17:01:41 UTC
Re: [PR] Fix(iOS): Restore iOS orientation locking with cordova-ios 8 [cordova-plugin-screen-orientation]
MartinKei commented on PR #142:
URL: https://github.com/apache/cordova-plugin-screen-orientation/pull/142#issuecomment-6252636567
I tested this PR in a production Cordova/Ionic app and it fixes the problem.
### Environment
- `cordova-ios` 8.1.1
- `cordova-plugin-screen-orientation` at this PR's commit `748cbbfe27a774d909fae1b85ae7a8dceef05813`
- Xcode 26.6 with the iOS 26.5 simulator (iPhone 17)
- Cordova Android 15.1.0 with the API 36 emulator, for a regression check
### What I tested
The app uses the standard `screen.orientation` interface: `lock('landscape')`, read `.type`, `unlock()`, `lock('portrait')`, read `.type`.
### Result on cordova-ios 8.1.1
- Before this PR (plugin 3.0.4): `lock('landscape')` left the type at `portrait-primary` (angle 0). The lock had no effect. The simulator log showed no landscape geometry update.
- With this PR: `lock('landscape')` reports `landscape-secondary` (angle -90), `unlock()` succeeds, and `lock('portrait')` reports `portrait-primary` (angle 0).
I also confirmed the root cause in the issue: `cordova-ios` 7.1.1 `CDVViewController.h` declares `supportedOrientations`, and `cordova-ios` 8.1.1 does not.
### Regression checks
- Android API 36 emulator: lock, unlock, and type still work. The Android code is unchanged.
- The iOS native build compiles the new category file without errors.
- The other app-level iOS scenarios still pass: file roundtrip, file recording path, notification timer, InAppBrowser, StatusBar, and visual layout.
I will use this commit in our app until a release contains the fix. Thank you for the patch.
--
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: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org