screen orientation lock does not work on iOS 12.x (ionic 4 with capacitor)
See original GitHub issueI’m submitting a … (check one with “x”) [x] bug report [ ] feature request [ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or https://ionicworldwide.herokuapp.com/
Current behavior:
Screen Orientation is not locked on iOS 12.x XCode console shows
⚡️ [log] - Current screen orientation portrait-primary
To Native Cordova -> CDVOrientation screenOrientation INVALID ["options": [3, portrait]]
Expected behavior:
Must lock the orientation
Steps to reproduce:
Related code: In my component I invoke
this.screenOrientation.lock(this.screenOrientation.ORIENTATIONS.PORTRAIT);
Please note that i use capacitor to support native features. The same code works fine in ionic 3.9.2 with cordova (no error and screen orientation is locked)
Other information:
Ionic info: (run ionic info
from a terminal/cmd prompt and paste output below):
alexs-mbp:bossdesk.mobile2 alexryltsov$ ionic info
Ionic:
ionic (Ionic CLI) : 4.5.0 (/Users/alexryltsov/.nvm/versions/node/v10.14.2/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.0.0-beta.17
@angular-devkit/build-angular : 0.10.7
@angular-devkit/schematics : 7.0.7
@angular/cli : 7.0.7
@ionic/angular-toolkit : 1.2.0
Capacitor:
capacitor (Capacitor CLI) : 1.0.0-beta.11
@capacitor/core : 1.0.0-beta.11
Cordova:
cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
Cordova Platforms : none
Cordova Plugins : no whitelisted plugins (1 plugins total)
System:
Android SDK Tools : 26.1.1 (/Users/alexryltsov/Library/Android/sdk/)
NodeJS : v10.14.2 (/Users/alexryltsov/.nvm/versions/node/v10.14.2/bin/node)
npm : 6.5.0
OS : macOS Mojave
Xcode : Xcode 10.1 Build version 10B61
alexs-mbp:bossdesk.mobile2 alexryltsov$
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (1 by maintainers)
Top Results From Across the Web
Ionic 4 application - screen orientation lock not working
I am trying to fix screen orientation to portrait for one page in my ionic 4 application. ... logging the current orientation and...
Read more >Ionic Screen Orientation Cordova Plugin is not locking to ...
First you will need to use Cordova net.yoik.cordova.plugins.screenorientation plugin. You can easily programmatically lock/unlock screen ...
Read more >Handling Screen Orientation Changes in Capacitor Apps
This tutorial discusses how to handle screen orientation changes on capacitor based Android and iOS apps. Fundamentals of an Ionic App.
Read more >Screen Orientation | Capacitor Documentation
iOS allows for different screen orientations to be supported on iPhones and iPads. To limit the allowed orientations for iOS, open Xcode and...
Read more >Change or lock the screen orientation on iPad - Apple Support
You can lock the screen orientation so that it doesn't change when you rotate iPad. Open Control Center, then tap the Lock Orientation...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Just found out that this error is back again event though the screen orientation lock seems to be working
Here is my current environment
I am still having this issue in ionic 4 using capacitor. works perfectly fine in IPhone but not working on IPad. Appreciate your help @mlynch @jcesarmobile