apache / apache/cordova-plugin-screen-orientation

Will not work with cordova-ios >= 8.0

Open
#140 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
219
Forks
234
PR merge metrics
No merged PRs in 30d

Description

# Bug Report

## Problem
when running this plugin with corodva ios 8 nothing will happen when calling lock. It will resolve with but with CDVCommandStatus_INVALID_ACTION

### What is expected to happen?

plugin should also lock the orientation in newer cordova-ios

### What does actually happen?

Can still change orientation.

## Information

cordova-ios has removed the property supportedOrientations in this commit:

https://github.com/apache/cordova-ios/commit/c6fd16f7eaa0cf368076ca0a02c7899e93cec15c#diff-41cd83cdfd0f80ba61d4f8577f2ff8bbf699bac3dc164f4b39e4510673dec4b0L58-R87

This is needed here:

https://github.com/apache/cordova-plugin-screen-orientation/blob/94d9f1cd88b0db777fbdf4842a862adc08a20644/src/ios/CDVOrientation.m#L141-L143

### Command or Code

### Environment, Platform, Device

ios 18.2.1
iphone 16

### Version information

Ionic:

Ionic CLI : 7.1.1 (/opt/homebrew/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 8.8.4
@angular-devkit/build-angular : 20.3.25
@angular-devkit/schematics : 20.3.25
@angular/cli : 20.3.25
@ionic/angular-toolkit : 12.3.0

Cordova:

Cordova CLI : 12.0.0 (cordova-lib@12.0.2)
Cordova Platforms : ios 8.0.1

System:

ios-deploy : 1.10.0
NodeJS : v25.9.0
OS : macOS Unknown
Xcode : Xcode 26.4.1 Build version 17E202

## 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

Contributor guide

Open the contributing guide

Research direction

Start with src/ios/CDVOrientation.m at lines 141-143 and compare its use of supportedOrientations with the linked cordova-ios change. Reproduce by calling lock on cordova-ios 8.0.1, then verify that the plugin no longer returns CDVCommandStatus_INVALID_ACTION and that orientation locking works on iOS.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, javascript, objective-c
Domain
mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.