cordova-plugin-screen-orientation icon indicating copy to clipboard operation
cordova-plugin-screen-orientation copied to clipboard

With the 3.0.2 version, the turn orientation change for iOS on landscape mode

Open Stephane84 opened this issue 5 years ago • 6 comments

Bug Report

Problem

With the 3.0.2 version, the turn orientation change for iOS on landscape mode

What is expected to happen?

I have an ionic3 app in portrait mode, fixed in config.xml :

in 3.0.1, when using ionic native : this.screenOrientation.lock(this.screenOrientation.ORIENTATIONS.LANDSCAPE); the app turn right, and we turn the device on left to have the top of the device on left I use this orientation on a specific page, not on all

What does actually happen?

in 3.0.2 : the app turn left, and we turn the device on right to have the top of the device on right

Information

Seems to be this PR who include the bug : https://github.com/apache/cordova-plugin-screen-orientation/pull/25

Command or Code

this.screenOrientation.lock(this.screenOrientation.ORIENTATIONS.LANDSCAPE);

Environment, Platform, Device

on iOS only, android still work well

Version information

"@ionic-native/screen-orientation": "4.7.0", "ionic-angular": "3.9.2", "cordova-plugin-screen-orientation": "3.0.2",

Checklist

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

Stephane84 avatar Jul 04 '19 12:07 Stephane84

As I understand the PR this was actually a bug on iOS before (vs. how it should work and how it works on other platforms) that has been fixed there. Do you disagree?

janpio avatar Jul 04 '19 12:07 janpio

Well, as i understand, there was a bug when in landscape mode, doing screen.orientation.lock(landscape);, it flips to the opposite landscape i don't have this case in my app. My app is fixed in portrait, and i switch from portrait to landscape and landscape to portrait only with 2 different button (one in a page, the other in a modal)

For my app, the PR solve no problem ,but add this issue

Stephane84 avatar Jul 04 '19 13:07 Stephane84

Can you visualize this with screenshots or even better a repro app? I am not sure I fully understand what is going on.

janpio avatar Jul 04 '19 14:07 janpio

Sorry for the poor screenshot edited in paint quality, but here is the problem

image

Our ionic application is fixed in portrait in config.xml

<preference name="Orientation" value="portrait" />

The only time we switch to landcape is when clicking on the arrow (in red in my beautiful screenshot). typescript code is

this.screenOrientation.lock(this.screenOrientation.ORIENTATIONS.LANDSCAPE);

(we are using ionic-native adaptation of the plugin : https://ionicframework.com/docs/native/screen-orientation/ )

With 3.0.1 plugin, both android and iphone were rotating in the same direction (top one on screenshot), so counter clockwise With 3.0.2 plugin, iphone is rotating clockwise

Asterodeia avatar Jul 08 '19 08:07 Asterodeia

Thank you! And I though the bugfix in 3.0.2 would actually fix this to be correct...

Can you create a new project with some minimal pages that reproduces this problem? I need to look at it myself. (Ionic is fine in this case - but if you want to do it in plain Cordova you of course get bonus points)

janpio avatar Jul 08 '19 09:07 janpio

@Stephane84 - Just try once from here, Seems it will work for you. https://github.com/Anuj-logiciel/cordova-plugin-screen-orientation

Anuj-logiciel avatar Jul 30 '19 18:07 Anuj-logiciel