When we first approached the problem, we did it the same way a physicist might approach trying to unify the forces of nature — we tried to find the most general solution possible. In this particular case, we were trying to find a general workaround that simultaneously addressed the issue on iOS 6 while still being backwards compatible on iOS 5 and iOS 4.3. This led to an unhappy stopgap measure, i.e. #3 in last week’s FAQ.
Personally, I wasn’t happy with the stopgap, so last last week, I asked the team to take another look and see if we could come up with something better. By Friday, we started playing with a new strategy and we think it works a lot better.
The new strategy is equivalent to doing a surgical strike. What we’re doing is making this workaround only happen on iOS 6. Further, because this only happens on iPhone and iPod Touches — on iPad, there’s no issue — this workaround is only active on those devices.
What you need to do is add a special key ‘CoronaUseIOS6LandscapeOnlyWorkaround’ into your ‘Info.plist’. We purposely named this something unfriendly because we expect Apple will fix this bug in an upcoming dot release.
You can do this by adding a special ‘plist’ section to your ‘build.settings’ file. Here’s an example showing the minimal configuration you need:
(NOTE: If you have attempted to use the previous workaround, you should remove any ‘portrait’ settings and also remove the ‘content’ key. Or you should just use the above ‘build.settings’ so you’re starting clean.)
Basically, you are telling Corona that you are a landscape app (just like before), and that you want to activate the special workaround. This workaround is crafted to run only on the iPhone or iPod Touch running iOS 6. On iOS 5, there is no Game Center bug, so your apps will run in landscape just fine.
Now, there’s still one last problem and that pertains to the photo picker on iPads running iOS 6. If you have a landscape app, you’ll hit a similar crash. We’ve got a working coming in the next daily build.
UPDATE #1: Daily build 931 addresses the photo picker issue. You’ll want to add a similar ‘plist’ flag and set the key ‘CoronaUseIOS6IPadPhotoPickerLandscapeOnlyWorkaround’ to ‘true’.
UPDATE #2: Daily build 933 enhances the ‘CoronaUseIOS6LandscapeOnlyWorkaround’ iOS 6 workaround for situations where you need a fixed orientation (no auto-orientation). If you specify only “landscapeLeft” or “landscapeRight” (i.e. only one, not both) in the ‘supported’ orientations array in build.settings, Corona now honors that.
Posted by Walter. Thanks for reading...