Skip to content

Will not work with cordova-ios >= 8.0 #140

Description

@DavidWiesner

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:

apache/cordova-ios@c6fd16f#diff-41cd83cdfd0f80ba61d4f8577f2ff8bbf699bac3dc164f4b39e4510673dec4b0L58-R87

This is needed here:

SEL selector = NSSelectorFromString(@"setSupportedOrientations:");
if([vc respondsToSelector:selector]) {

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

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions