iPad Multitasking support requires these orientations
Spreaker Studio is an Universal app. On iPhone the app works only in portrait. On iPad it works only in (both) landscapes. Interface rotation is enabled only on iPad, to allow user to choose where usb/headphone cable goes.
This morning I notice this app rotates on all orientations on tablet. This is unexpected because we declare on each view controller which orientations are allowed or not.
The point is that our Info.plist
contains all interface orientations supported (both iPhone and iPad) letting each view controller, at runtime, decide which one is accepted or not.
From iOS9, Info.plist options overrides ANY interface rotation behaviour
The way I fix it is separating supported orientations per device, this way
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
Easy enough. Build, archive, validate, submit and … error!
A fancy new-to-me error message from iTunes Connect
Invalid Bundle. iPad Multitasking support requires these orientations: ‘UIInterfaceOrientationPortrait,UIInterfaceOrientationPortraitUpsideDown, UIInterfaceOrientationLandscapeLeft,UIInterfaceOrientationLandscapeRight’. Found ‘UIInterfaceOrientationPortrait,UIInterfaceOrientationPortraitUpsideDown’ in bundle ‘…’.
By the way, the build passed the validation but fails just the submission.
Googling around
30 seconds later, I found this discussion on StackOverflow that resolve this problem.
With iOS9, all apps by default support multitasking (Split View, Slide Over and Picture in Picture, these stuff) but this requires your app to support all interface orientations.
If you, like me, are not ready for this extra work, the only way is to opt-out from multitasking by turning ON Requires full screen
(aka UIRequiresFullScreen
) option inside your app Info.plist
.
So, app Info.plist
now contains these rows.
<key>UIRequiresFullScreen</key>
<true/>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
Build, archive, validate, submit and … success! Until the next iOS version of course.
Alessandro