This has got to be the strangest bug I’ve seen in all my years as a developer.
I’ve built an iPhone app that displays content in portrait mode, then changes orientation from landscape to portrait using Screen.Orientation = ScreenOrientation.LandscapeLeft.
I build in Unity, then compile the app in XCode using an Ad Hoc provisioning profile. I send it out to my beta testers and everything works fine.
I compile the exact same app again in XCode (not even rebuilding in Unity) with the only change being that I use an App Store provisioning profile. I submit it to the AppStore, it gets approved and released, but…
The screen orientation change doesn’t work.
When it switches from portrait to landscape, I get landscape mode but what appears to be portrait-mode aspect ratio with a large black area to the right. See attached screenshot.
I’m using Unity 5.3.4p1 and the latest version of XCode, and testing on multiple iPhones from 4s to 6 running various versions of iOS.
This happens only in the App Store build, not in that Ad Hoc build. It’s extremely hard to debug, since I have to do an App Store submission each time.
Any suggestions would be greatly appreciated.
Thanks!
Code to change orientation:
private IEnumerator FlipAndDisplay() {
Screen.orientation = ScreenOrientation.LandscapeLeft;
yield return null;
readyScreenWebview.Show();
}