You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2020/07/03 11:44:13 UTC

[GitHub] [cordova-plugin-screen-orientation] sagits opened a new issue #68: .lock(ORIENTATIONS.LANDSCAPE) not working if the phone auto rotation is enabled

sagits opened a new issue #68:
URL: https://github.com/apache/cordova-plugin-screen-orientation/issues/68


   # Bug Report
   
   ## Problem
   
   I've tested on both iOS 12 and 13. My app is locked through config.xml to allow only portrait mode. I have a page using Ionic 5. When the user navigates to this page I try to lock on landscape and when he leaves I lock on portrait again.
   
   ### What is expected to happen?
   
    Even if the phone auto-rotation is enabled, the phone should turn to landscape (its a photo gallery page) when he enters the page.
   
   
   ### What does actually happen?
   
   If the phone autorotation is disabled the app turns to landscape when he enters the page, but if the phone autorotation is enabled sometimes it rotates and sometimes doesn't. I think the problem is that if the phone is not 100% in portrait mode (lets say you are holding it inclined) or if its already in portrait mode, the plugin cant manage to turn the orientation.
   
   
   ## Information
   
   
   ### Command or Code
   
   When the user enters the page:
   ```
        ionViewWillEnter() {
               this.screenOrientation.lock(this.screenOrientation.ORIENTATIONS.LANDSCAPE).then((data) => {
               });
       }
   ```
   
   and when user leaves:
   
   ```
       ionViewWillLeave() {
             this.screenOrientation.lock(this.screenOrientation.ORIENTATIONS.PORTRAIT);
       }
   ```
   
   
   
   ### Environment, Platform, Device
   `"cordova-plugin-screen-orientation": "^3.0.2",`
   `"@ionic/angular": "^5.2.2",`
   `ios 12 as 13 on Iphone`
   
   
   
   ### Version information
   <!-- 
   What are relevant versions you are using?
   For example:
   Cordova: Cordova CLI, Cordova Platforms, Cordova Plugins 
   Other Frameworks: Ionic Framework and CLI version
   Operating System, Android Studio, Xcode etc.
   -->
   
   
   
   ## Checklist
   <!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
   
   - [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
   


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

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


[GitHub] [cordova-plugin-screen-orientation] Manugal edited a comment on issue #68: .lock(ORIENTATIONS.LANDSCAPE) not working in iOS 12 13 if the phone auto rotation is enabled

Posted by GitBox <gi...@apache.org>.
Manugal edited a comment on issue #68:
URL: https://github.com/apache/cordova-plugin-screen-orientation/issues/68#issuecomment-656221518


   Hi,
   I am experiencing the exact same problem. As workaround, I found that adding the following line to `CDVOrientation.m` at line 84 solved the problem in my case:
   
   `[UINavigationController attemptRotationToDeviceOrientation];`
   
   I could send a PR if maintainers agree on the solution.


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

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


[GitHub] [cordova-plugin-screen-orientation] Manugal commented on issue #68: .lock(ORIENTATIONS.LANDSCAPE) not working in iOS 12 13 if the phone auto rotation is enabled

Posted by GitBox <gi...@apache.org>.
Manugal commented on issue #68:
URL: https://github.com/apache/cordova-plugin-screen-orientation/issues/68#issuecomment-656221518


   Hi,
   I am experiencing the exact same problem. As workaround I found that the following line added to `CDVOrientation.m` at line 84 solved the problem in my case:
   
   `[UINavigationController attemptRotationToDeviceOrientation];`
   
   I could send a PR if maintainers agree on the solution.


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

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


[GitHub] [cordova-plugin-screen-orientation] Manugal edited a comment on issue #68: .lock(ORIENTATIONS.LANDSCAPE) not working in iOS 12 13 if the phone auto rotation is enabled

Posted by GitBox <gi...@apache.org>.
Manugal edited a comment on issue #68:
URL: https://github.com/apache/cordova-plugin-screen-orientation/issues/68#issuecomment-656221518


   Hi,
   I am experiencing the exact same problem. As workaround, I found that adding the following instruction to `CDVOrientation.m` at line 84 solved the problem in my case:
   
   `[UINavigationController attemptRotationToDeviceOrientation];`
   
   I could send a PR if maintainers agree on the solution.


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

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