expo: [expo-screen-orientation] ScreenOrientation.lockPlatformAsync does not work on iOS 16
Summary
The ios/EXScreenOrientation/EXScreenOrientationRegistry.m file in the enforceDesiredDeviceOrientationWithOrientationMask
function calls ‘[[UIDevice currentDevice] setValue:@(newOrientation) forKey:@“orientation”];’ This function has been deprecated in iOS 16, as mentioned here https://developer.apple.com/forums/thread/707735. This results in not being able to perform a screen rotation on my iOS 16 Iphone device. I am able to perform a screen rotation with the same code on iOS <= 15 and Android.
What platform(s) does this occur on?
iOS
Environment
expo-env-info 1.0.5 environment info: System: OS: macOS 13.2 Shell: 3.2.57 - /bin/bash Binaries: Node: 14.18.3 - /usr/local/bin/node Yarn: 1.22.17 - /opt/homebrew/bin/yarn npm: 8.5.0 - ~/.npm-global/bin/npm Managers: CocoaPods: 1.11.3 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1 IDEs: Android Studio: 2021.3 AI-213.7172.25.2113.9123335 Xcode: 14.2/14C18 - /usr/bin/xcodebuild npmPackages: expo: ^46.0.0 => 46.0.16 react: 18.0.0 => 18.0.0 react-dom: 18.0.0 => 18.0.0 react-native: 0.69.7 => 0.69.7 react-native-web: ~0.18.7 => 0.18.10 npmGlobalPackages: eas-cli: 2.6.0 expo-cli: 6.0.8 Expo Workflow: bare
Minimal reproducible example
https://snack.expo.dev/@matthewgaba/expo-screenorientation
Run this in an iOS simulator on iOS 16+ and you will see that the screen rotation does not work.
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 4
- Comments: 23 (10 by maintainers)
Any update? Inability to control screen rotation on iOS 16 in Expo seems like it would be a high-priority issue to fix.
@amit13091992 This fix will be included in SDK 49