You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by Dan Field <df...@gmail.com> on 2017/11/25 01:27:37 UTC

Cordova-plugin-screen-orientation on iOS

Hi all,

I've submitted a pull request here: https://github.com/
apache/cordova-plugin-screen-orientation/pull/24#event-1357350620 (jira
issue here: https://issues.apache.org/jira/browse/CB-13405) related to the
iOS behavior of this plugin.  The basic issue is that when the screen is
locked and then unlocked in iOS, it doesn't automatically return to the
orientation the user had before locking.  It will respond if the user
manually turns the device a few times, but it can result in the orientation
getting "stuck" in the locked position temporarily until the user starts
turning the device.

My solution is to record the position the phone is in before locking and
attempt to set the orientation back to that initial position.  This has
resulted in a better use experience in our testing for the production app I
work on.  I'm doing this in the iOS specific code because the same issue
doesn't occur on Android (at least on versions that I've tested, 6.x and
7.x).

I'd welcome any comments/reviews/feedback!

Thanks,

Dan

Re: Cordova-plugin-screen-orientation on iOS

Posted by Jan Piotrowski <pi...@gmail.com>.
Hey Dan,

I don't know enough Obj-C to review this, but this sounds like a
_really_ useful feature and change. Hope someone else can review this,
so it can become part of the plugin.

Thanks for the great work!

-J



2017-11-25 2:27 GMT+01:00 Dan Field <df...@gmail.com>:
> Hi all,
>
> I've submitted a pull request here: https://github.com/
> apache/cordova-plugin-screen-orientation/pull/24#event-1357350620 (jira
> issue here: https://issues.apache.org/jira/browse/CB-13405) related to the
> iOS behavior of this plugin.  The basic issue is that when the screen is
> locked and then unlocked in iOS, it doesn't automatically return to the
> orientation the user had before locking.  It will respond if the user
> manually turns the device a few times, but it can result in the orientation
> getting "stuck" in the locked position temporarily until the user starts
> turning the device.
>
> My solution is to record the position the phone is in before locking and
> attempt to set the orientation back to that initial position.  This has
> resulted in a better use experience in our testing for the production app I
> work on.  I'm doing this in the iOS specific code because the same issue
> doesn't occur on Android (at least on versions that I've tested, 6.x and
> 7.x).
>
> I'd welcome any comments/reviews/feedback!
>
> Thanks,
>
> Dan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org