iOS 8 Orientation Issue

So, we got rejected today from the App Store because on an iPhone 5S with iOS 8, it defaulted to the wrong orientation (portrait instead of landscape). Has anybody experienced this or know a sure-fire way to force the default?

We had the default in the player settings set to landscape left. It worked fine on an iPad 1 and an iPhone 4S running iOS 7.1.

I believe this patch will fix it (see “(none) - iOS: Fixed startup orientation handling on iOS8.”). I’m going to give it a go on our build.

That or Unity 4.5.4 which fixed it for us.

I got this issue and find set both landscape (left + right) will work

Xcode 6 + Unity 4.6

This is still an issue with 4.6 patch 21 beta.
There are two issues:

  1. if you change orientation the input.touch still thing it’s the old orientation and completely ignores values at the edges.
  2. if you take the app to bg then go back to the app, the orientation looks completely messed up. i.e only half the screen is rendering

I discovered a way to work around the issue with the app only rendering half the screen if you take it to background and go back. Every frame, you need to set the camera rect. Set it to (0, 0, 1, 1) and then it will render and accept touch inputs correctly.

This is my workaround with iOS8 and Xcode6:

Allow only Landscape Right orientation in Xcode.

Then change this one line in Classes/iPhone_OrientationSupport.mm from

case landscapeLeft:         return CGAffineTransformMakeRotation(M_PI_2);

to

case landscapeLeft:         return CGAffineTransformIdentity;

It still rotates into portrait for less than a second which is not great but at least it works.

goto iPhone_OrientationSupport.mm file and remove “return screenRect;” from ContentRectForOrientation method. Line number 18

CGRect ContentRectForOrientation(ScreenOrientation orient)
   {
     CGRect screenRect = [[UIScreen mainScreen] bounds];
      switch(orient)
        {
         case portrait:
         case portraitUpsideDown:
         case landscapeLeft:
         case landscapeRight:
        return CGRectMake(screenRect.origin.y, screenRect.origin.x,    screenRect.size.height, screenRect.size.width);
    default:
        return screenRect;
       }
  return screenRect;
}