thmclellan commented on PR #107:
URL:
https://github.com/apache/cordova-plugin-screen-orientation/pull/107#issuecomment-1307801779
Thanks @oofaish for sharing your fix! I've been testing on iOS 16.1 on a
physical iPhone 13 Pro Max (Capacitor 4.4, Ionic 5, Angular 12, XCode 14.1,
Ventura 13.0) and noticed two issues:
1 - Starting from primary portrait without my screen locked, calling
`window.screen.orientation.lock("landscape")` causes a strange double rotation
(see attached video). Calling
window.screen.orientation.lock("landscape-primary") works as expected.
From debugging, it seems
[L68](https://github.com/oofaish/cordova-plugin-screen-orientation/blob/b70782c4fc118625555ab739c746e27c3ae50af1/src/ios/CDVOrientation.m#L68)
(UIInterfaceOrientationMaskLandscapeLeft) is getting called in the general
landscape scenario, while L74 UIInterfaceOrientationMaskLandscapeRight is
getting called on landscape-primary.
2 - Calling `window.screen.orientation.unlock()` is causing a
requestGeometryUpdate error in Xcode:
`2022-11-08 11:44:59.124078-0800 App[3407:1282732] [Orientation] BUG IN
CLIENT OF UIKIT: Setting UIDevice.orientation is not supported. Please use
UIWindowScene.requestGeometryUpdate(_:)`
It seems L93 is being called on iOS 16:
`[[UIDevice currentDevice] setValue:[NSNumber
numberWithInt:_lastOrientation] forKey:@"orientation"];`
XCode complains but still executes L96
(`setNeedsUpdateOfSupportedInterfaceOrientations`) and presumably that does the
unlock.
This is minor stuff but wanted to share what I found while testing. Thanks
again
https://user-images.githubusercontent.com/9682900/200661364-19f4e0f9-6cd0-4bd1-b8d7-b18dd46d0ef0.mov
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]