I’m happy to report that we now have a superior workaround for the landscape/Game Center orientation issue in iOS 6. This is available in Corona daily build 930.

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.

  1. Chris Leyton (SegaBoy) says:

    Gah spoke too soon.

    Walter I seem to be having an issue. My app id designed to run in one landscape setting (landscapeLeft), as I have some challenges involving playing the game upside down; however, I’ve just noticed that the app is auto-rotating despite the fact I’ve only got “landscapeLeft” in my build.settings?

    FYI this is what I have:

    settings = {
    orientation = {
    default = “landscapeLeft”,
    supported = {“landscapeLeft”}
    },

    iphone = {
    components = {},
    plist = {
    CoronaUseIOS6LandscapeOnlyWorkaround = true,

  2. Hmmm seems my comment before that wasn’t posted?

    To recap:

    My app is designed to run in one landscape setting (landscapeLeft) as I have some challenges involving playing the game upside down. The fix however doesn’t appear to work as the game is now auto-rotating, despite only setting ‘landscapeLeft’ in the build.settings file.

    As I mentioned above it doesn’t auto-rotate in the Corona simulator.

    FYI:

    settings = {
    orientation = {
    default = “landscapeLeft”,
    supported = “landscapeLeft”
    },

    iphone = {
    components = {},
    plist = {
    CoronaUseIOS6LandscapeOnlyWorkaround = true,

  3. Good to hear walter, this blog post has clarified the fix more (more so than the forum version). I feel more comfortable with implementing this fix on all my apps!.

    @Walter: Just an idea, why not just built-in this feature in Corona IF the supported orientation modes are landscape only? If Apple were to fix this then this would be in a next version (say 6.0.1), the fix can just be implemented inside Corona to work with iOS 6.0 only. Just my 2 cents

    • Believe me, we tried lots of general strategies — they failed spectacularly. The surgical strike strategy is the only one that we felt would work. It’s not ideal, but it does get the job done.

      Usually, we prefer a graceful workaround, so we considered an iOS 6.0-only approach but we don’t know if or when Apple will fix this in iOS 6 or not. Traditionally these fixes come in a major dot release (6.1) instead of a minor dot release (6.0.1) so we really felt we had to make it something you choose to opt into.

      • A week has past already since this blog post. It finally came into a point where I’m finishing/polishing my latest game and I just implemented this landscape fix. I’m just using GC though, no camera nor UI textfields/buttons. I saw in the daily builds that there’s another fix for that. I’m happy to say that there are no side effects to using CoronaUseIOS6LandscapeOnlyWorkaround in my case. Awesome! I’ll be updating all my other games now :)

  4. Yeah, I’m a little confused as to what negative side-effects this might impose?

    If there’s no negative side effects, I’m wondering why this is something we have to specifically setup in our builds? There’s plenty of Apple bugs that Corona graciously and automatically works around for us.

    ;-)

    Best,
    ~~Kenn

    • @kenn, see my reply to @bfintal above, or the beginning of my post. If we could have found a graceful solution that was completely general (all use cases, not just pet use cases), then we would have.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>