Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS 9 : Warning "All interface orientations must be supported unless the app requires full screen" for universal app

I'm working on an universal app with all orientations on iPad and only portrait on iPhone. The app works well with split-screen multitasking on iOS 9 compatible iPad, but I have this warning:

All interface orientations must be supported unless the app requires full screen

And my app does not require full screen. It's only limited to portrait on iPhone... Shouldn't it be ok? Is there a way to declare Requires Full Screen only on iPhone?

Thanks in advance

By the way I'm using Xcode 7.3.1

like image 585
Zaphod Avatar asked May 11 '16 16:05

Zaphod


3 Answers

Set UIRequiresFullScreen to YES in Info.plist.

enter image description here

Enjoy...!!!

like image 51
mital solanki Avatar answered Oct 17 '22 07:10

mital solanki


The solution to this is to use "Device Specific Keys": https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/AboutInformationPropertyListFiles.html#//apple_ref/doc/uid/TP40009254-SW9

Your plist values would therefore look something like:

<key>UISupportedInterfaceOrientations</key>
<array>
    <string>UIInterfaceOrientationPortrait</string>
    <string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
    <string>UIInterfaceOrientationPortrait</string>
    <string>UIInterfaceOrientationPortraitUpsideDown</string>
    <string>UIInterfaceOrientationLandscapeLeft</string>
    <string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIRequiresFullScreen</key>
<true/>
<key>UIRequiresFullScreen~ipad</key>
<false/>

When I remove the iPad specific version of the UIRequiresFullScreen key, I lose the full split-screen functionality - only "slide over" is available because that doesn't affect my app's use of the full device screen.

The "Device Orientation" checkboxes are for the default plist values. The only way they wouldn't affect the app on the iPad is if there's a more specific value in the plist, therefore a value specifically for iPad.

When the system searches for a key in your app’s Info.plist file, it chooses the key that is most specific to the current device and platform.

like image 45
siburb Avatar answered Oct 17 '22 05:10

siburb


In fact, it was too easy... That's why I haven't even tried it:

Configuration

Setting Portrait for Device Orientation does not impact iPad orientation.

That means that the Device Orientation section should be renamed iPhone Orientation, indeed, with that configuration, the iPhone only supports Portrait and the iPad supports all of them. And the split-screen is still allowed as we have not checked Requires full screen.

PS: At least on Xcode 8.3.1, I have not tested it on Xcode 7.x

like image 10
Zaphod Avatar answered Oct 17 '22 07:10

Zaphod