I haven’t tested it myself, but the documentation says:
ScreenOrientation
from expo
allows changing supported screen orientations at runtime, and subscribing to orientation changes. This will take priority over the orientation
key in app.json.
I would have expected the app.json
setting to generate the setting(s) in Info.plist
. So I would interpret the above to mean that ScreenOrientation
is supposed to override the settings in Info.plist
.
But it goes on to say:
Apple added support for split view mode to iPads in iOS 9. This changed how the screen orientation is handled by the system. To put the matter shortly, for the iOS, your iPad is always in the landscape mode unless you open two applications side by side. In order to be able to lock screen orientation using this module you will need to disable support for this feature. For more information about the split view mode, check out the official Apple documentation.
I’m not sure I understand that fully. I do not own an iPad and have not read Apple’s split view docs. But it sounds like the app would be forced to landscape mode unless you open it in split screen mode, or you disable the split screen feature.
You say your app can switch to landscape, rather than being forced to landscape mode, though, so maybe you have already disabled split screen mode?
If the problem is with the Info.plist
file, then it might be that there’s a config plugin doing that.
If I were you I would run expo prebuild -p ios
to generate the native iOS project files. (Make sure your project is committed to Git first so you can easily revert the changes afterwards.) Then check the Info.plist
to see what it contains.
Then I would dig arould in the expo/expo-cli
, expo/expo
, expo/config-plugins
repositories for a config plugin that might be adding the orientation settings to Info.plist
.
Once you know where it’s coming from you could probably use patch-package
or a config plugin of your own to fix it.
But if app.json
and ScreenOrientation
are not working and you can create a small example that demonstrates the problem, I suggest you create an issue in the expo/expo
github repository.