expo: "orientation: portrait" in app.json does not prevent orientation change on iPad- iOS 12.4
🐛 Bug Report
Environment
Expo CLI 3.0.9 environment info:
System:
OS: macOS 10.14.6
Shell: 5.5.1 - /usr/local/bin/zsh
Binaries:
Node: 10.15.3 - /usr/local/bin/node
Yarn: 1.10.1 - /usr/local/bin/yarn
npm: 6.10.3 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
IDEs:
Android Studio: 3.4 AI-183.6156.11.34.5522156
Xcode: 10.3/10G8 - /usr/bin/xcodebuild
npmPackages:
expo: ^34.0.1 => 34.0.4
react: 16.8.3 => 16.8.3
react-native: https://github.com/expo/react-native/archive/sdk-34.0.0.tar.gz => 0.59.8
react-navigation: ^3.11.0 => 3.11.1
Steps to Reproduce
- Create template expo app
npm i -g expo-cli@3.0.9
expo init (picking the tabs template)
app.json
{
"expo": {
"name": "expo-template",
"slug": "expo-template",
"privacy": "public",
"sdkVersion": "34.0.0",
"platforms": [
"ios",
"android",
"web"
],
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/images/icon.png",
"splash": {
"image": "./assets/images/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": [
"**/*"
],
"ios": {
"supportsTablet": true
}
}
}
- Start app in portrait orientation on iPad 5th Generation (WiFi) - iOS 12.4
- Turn device to landscape orientation
Expected Behavior
Screen should not change orientation
Actual Behavior
Screen does change orientation
Reproducible Demo
Sorry, please dont close this issue, but I can’t work out a way to change the orientation of a snack. If it is possible, please let me know how and I will make one ASAP. 😃
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 7
- Comments: 15 (3 by maintainers)
This bug is still present on SDK 40
I’m seeing this in v42. Was it really fixed?
still not fixed in v45 😦
Update
This is only an issue in the expo client. After building the app and installing the
.ipafile on the same iPad, the orientation is locked to portrait.I think this warrants a documentation change on this page: https://docs.expo.io/versions/latest/workflow/configuration/
Looks like there’s a special orientation property for iPad (
UISupportedInterfaceOrientations~ipad) that Expo isn’t setting. You can use plugins to set this property in the Info.plist file for iOS, try this if you’re using EAS (managed flow):Create a
withCustomInfoPlist.jsfile with something like this code (in this case it enables the “portrait” orientation only):Use the path to this custom plugin in your
app.jsonorapp.config.jslike:Create a new build and at least for me the issue was fixed.
Does not seem to be working. I’m on SDK 49 and
orientation: 'portrait'leads to this result:I’ve tried using app config but that also doesn’t work:
results in
UPDATE: The answer is that Expo is “smart” enough to add the iPad orientations because it’s required when the app supports multitasking on iPadOS. Setting
ios.requireFullScreentotrue, in combination witorientation: 'portrait'solves the issue.