apache / apache/cordova-plugin-screen-orientation

Ionic 5.x/Screen-Orientation lock does not work on iOS platform

Open
#62 15 comments 5 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
Unable to lock the screen orientation on iOS using the latest version of the ionic framework and the plugin.

### What is expected to happen?

I'm expecting that both the splash screen and my sign-in page is locked into portrait mode on both iOS and Android.

### What does actually happen?

When the app is launched, and the iOS device is in landscape, the splash screen and sign-in page are displayed in landscape.

## Information

- issue observed only on iOS
- issue observed only on iOS 13.3.1

### Command or Code

import { ScreenOrientation } from '@ionic-native/screen-orientation/ngx';

constructor(
.
.
.
private screenOrientation: ScreenOrientation,
.
.
.
) {
.
.
.
this.platform.ready().then(() => {
this.screenOrientation.lock(this.screenOrientation.ORIENTATIONS.PORTRAIT);
});
}

### Environment, Platform, Device

iOS 13.3.1
iPhone XS Max

### Version information

Ionic:

Ionic CLI : 5.4.5
Ionic Framework : @ionic/angular 5.0.7
@angular-devkit/build-angular : 0.803.25
@angular-devkit/schematics : 8.3.25
@angular/cli : 8.3.25
@ionic/angular-toolkit : 2.1.2

Cordova:

Cordova CLI : 9.0.0 (cordova-lib@9.0.1)
Cordova Platforms : ios 5.1.1
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.1.3, (and 11 other plugins)

Utility:

cordova-res : not installed
native-run : 0.3.0

System:

Android SDK Tools : 26.1.1 (/Users/meusercx/Library/Android/sdk)
ios-deploy : 1.9.2
ios-sim : 8.0.2
NodeJS : v10.15.1 (/usr/local/bin/node)
npm : 6.14.4
OS : macOS Catalina
Xcode : Xcode 11.3.1 Build version 11C504

-----

package.json...
"@ionic-native/screen-orientation": "^5.23.0",
"cordova-plugin-screen-orientation": "3.0.2",

## 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 by reproducing the sample ScreenOrientation lock call on an iPhone XS Max running iOS 13.3.1 with cordova-plugin-screen-orientation 3.0.2. Inspect the plugin's iOS implementation and verify that the splash screen and sign-in page remain portrait when launched in landscape, while preserving the Android behavior described in the report.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, javascript
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.