iOS 6 Orientation Crash

Tom (or anyone who knows)

Could you please post an example build.settings file that shows the workaround working for a landscape only app that supports *both* landscape orientations? (I understand that native objects will still rotate to portrait)

I’ve tried many combinations in settings but I still get NON-native assets (ie all the corona display objects) rotating to portrait as well. Worse, if the user starts my app in portrait mode it bungles up all the corona content when they do rotate to landscape.

The workaround originally posted above only supports one landscape orientation. I need to support both, with the ability to open user’s image library, without crashing on iOS 6. [import]uid: 9422 topic_id: 31056 reply_id: 126123[/import]

There are (native) workarounds suggested at StackOverflow for this issue. Is this something that Corona SDK could implement?

http://stackoverflow.com/questions/12522491/crash-on-presenting-uiimagepickercontroller-under-ios6/12575058#12575058
[import]uid: 48484 topic_id: 31056 reply_id: 125901[/import]

Just sharing another link with suggestions (native workarounds) for the above issue, don’t know if this could be of any help here.

http://grembe.wordpress.com/2012/09/19/here-is-what-i/

Our landscape-only game doesn’t have game center integration, however, we have native text fields and photo picker functionalities.

I would really appreciate if there is a workaround/suggestions for this crash issue. [import]uid: 48484 topic_id: 31056 reply_id: 126153[/import]

Tom, I rechecked our build.settings and set it as exactly same as Kimberly Horne suggested on comment #3, and now our app keeps landscape. Sorry for the confusion I made.

However the WebView, the only native control we use, still rotates, and even worth it is locked 90 degree rotated when the Portrait Orientation Lock is enabled by user.
I’m still unconvinced that this is something Apple is to fix.

As for Unity, I read some blog article and tweets from developer that they say they fix specifically the Game Center issue, though it’s in Japanese and I couldn’t find English information about this.
http://akisute.com/2012/09/unity-355-game-center-iad-uiimagepicker.html [import]uid: 132466 topic_id: 31056 reply_id: 126213[/import]

Tossing that through Google Translate, it looks like they’re explaining the bug, but they haven’t fixed it either.

Would it be possible to include this fix if Corona detects that only landscape options are listed in build.settings?

https://devforums.apple.com/message/731764#731764 [import]uid: 105445 topic_id: 31056 reply_id: 126287[/import]

We had our iOS engineer spend two days on this and looked at all the options and there is no general purpose solutions that works. We can do it using private Apple APIs but that will be rejected if you try to submit the app to the App store. My FAQ blog post for this week talks about this issue.
http://www.coronalabs.com/blog/2012/10/03/faq-wednesday-ios6-bugs/

Everyone needs to file a bug report with Apple so this gets fixed ASAP. [import]uid: 7559 topic_id: 31056 reply_id: 126308[/import]

That workaround does not work. If I have

orientation = {  
 default = "landscapeRight",  
 content = "landscapeRight",  
 supported = { "landscapeRight", "portrait" },  
},  

then all my content displays in landscapeRight and portrait. I am using no native display objects, just Corona, and those non-native display objects rotate too. This is using build 2012.926. [import]uid: 105445 topic_id: 31056 reply_id: 126312[/import]

If I understand it correctly, the workaround above just allows the app to rotate to portrait mode, and our app is designed to work in landscape mode only, thus the workaround is not acceptable.

There are already a *true* workaround out there which can only be implemented in native code. It seems Unity already shipped a version with it built in.
http://stackoverflow.com/a/12427983
http://unity3d.com/unity/whats-new/unity-3.5.6

Many games in App Store which are optimized for iPhone 5 and run in landscape only already run seamlessly with Game Center, and we can’t ship our game if it looks ugly in portrait.

Is there any good reason for Corona not to have the workaround built in? [import]uid: 132466 topic_id: 31056 reply_id: 126092[/import]

If that’s all you have in your build.settings, it won’t work. This is what I have in my build.setting file and it works fine for me.

[code]
settings = {
orientation =
{
default = “landscapeRight”,
content = “landscapeRight”,
supported = { “landscapeRight”, “portrait” },
},
iphone =
{
plist=
{
CFBundleIconFile = “Icon.png”,
CFBundleIconFiles = {
“Icon.png”,
“Icon@2x.png”,
“Icon-72.png”,
},

CFBundleIdentifier = “com.appledts.GKTapper”, – Apple’s GameCenter Example (GKTapper)
},
components = {} – no openfeint
–components = { “openfeint” } – for openfeint & gamecenter
}
}
[/code] [import]uid: 7559 topic_id: 31056 reply_id: 126326[/import]

I noticed in today’s FAQ Wednesday:

“…Note that the content = “landscapeRight” line. Corona limits this setting to only one orientation…”

From this i gather I can’t use this workaround and support both landscapeRight and landscapeLeft. But it gives my app an amateurish feel to only support a single, fixed orientation, so I’m wondering if this is something that can by addressed by Coronalabs, at least until Apple fixes their bug. Basically i’d like “content” to support more than one orientation, just like “supported” does. [import]uid: 9422 topic_id: 31056 reply_id: 126327[/import]

@Tom,

Of course that’s not everything. Here’s everything (minus a few bits that are not iOS-rotation-related; it can build without the omitted bits).

settings =  
{  
 orientation =  
 {  
 default = "landscapeRight",  
 supported =  
 {  
 "landscapeRight",  
 "landscapeLeft"  
 },  
 },  
 iphone =  
 {  
 plist =  
 {  
 components = {},  
 CFBundleVersion = "66",  
 CFBundleIdentifier = "com.playgearz.toss",  
 CFBundleIconFile = "Icon.png",  
 CFBundleIconFiles = {  
 "Icon.png" ,   
 "Icon@2x.png" ,   
 "Icon-72.png" ,   
 "Icon-Small.png" ,   
 "Icon-Small-50.png" ,   
 "Icon-Small@2x.png"  
 },  
 UIInterfaceOrientation = "UIInterfaceOrientationLandscapeRight",  
 UISupportedInterfaceOrientations = {  
 "UIInterfaceOrientationLandscapeRight",  
 "UIInterfaceOrientationLandscapeLeft"  
 },  
 UIApplicationExitsOnSuspend = false,  
 UIStatusBarHidden = true  
 },  
 }  
}  
  
settings.iphone.plist["UIInterfaceOrientation~ipad"] = "UIInterfaceOrientationLandscapeLeft"  
settings.iphone.plist["UISupportedInterfaceOrientations~ipad"] =   
{  
 "UIInterfaceOrientationLandscapeRight",  
 "UIInterfaceOrientationLandscapeLeft"  
}  

I replaced the orientation part with…

orientation = {  
 default = "landscapeRight",  
 content = "landscapeRight",  
 supported = { "landscapeRight", "portrait" },  
},  

…and it made everything rotate into portrait.

Note that I did not change the UISupportedInterfaceOrientations or settings.iphone.plist[“UISupportedInterfaceOrientations~ipad”] parts, just the “orientation” section. Changing just the “orientation” section, by itself, made non-native content rotate into portrait. (It also prevented the content from rotating into landscapeLeft, but that was expected.)

As with Stephen, we need this to work for landscapeLeft and landscapeRight - but first we need this to work, period, and it does not. [import]uid: 105445 topic_id: 31056 reply_id: 126328[/import]

@orz, the workaround does keep you game in landscape mode and allows the GameCenter to run in portrait mode when needed. The only problem with that solution is all native objects (e.g., textFields and textBoxes) would also rotate to Portrait mode while the rest of your app was in landscape.

We have looked at some native code solutions and they still allow native objects to rotate, so that’s no better than what we have now. We also looked at subclassing the GCK but that has a high chance of being rejected by Apple.

The Unity link didn’t mention anything about GC, just that it fixed iOS6 orientation bugs so I don’t really know if they found a solution.

The Stackoverflow link talked about a fix but in the end they admitted that there were still problems:
“Yes, like it’s written in the post title problem appears in “GameCenter authentication in landscape-only”. It seems that GC just doesn’t have landscape assets for auth screen for iphone in ios6, so I suspect you won’t find a real solution - only workaround described here. That is why you have to allow app to launch in portrait mode when GC wants - but deny portrait in your main view - if you don’t want portrait of course. By the way, there is no such a problem in ipad on ios6. – Tertium yesterday”

We are trying to find a solution that works but in the end Apple has to fix this issue. [import]uid: 7559 topic_id: 31056 reply_id: 126118[/import]

Tom (or anyone who knows)

Could you please post an example build.settings file that shows the workaround working for a landscape only app that supports *both* landscape orientations? (I understand that native objects will still rotate to portrait)

I’ve tried many combinations in settings but I still get NON-native assets (ie all the corona display objects) rotating to portrait as well. Worse, if the user starts my app in portrait mode it bungles up all the corona content when they do rotate to landscape.

The workaround originally posted above only supports one landscape orientation. I need to support both, with the ability to open user’s image library, without crashing on iOS 6. [import]uid: 9422 topic_id: 31056 reply_id: 126123[/import]

Just sharing another link with suggestions (native workarounds) for the above issue, don’t know if this could be of any help here.

http://grembe.wordpress.com/2012/09/19/here-is-what-i/

Our landscape-only game doesn’t have game center integration, however, we have native text fields and photo picker functionalities.

I would really appreciate if there is a workaround/suggestions for this crash issue. [import]uid: 48484 topic_id: 31056 reply_id: 126153[/import]

Tom, I rechecked our build.settings and set it as exactly same as Kimberly Horne suggested on comment #3, and now our app keeps landscape. Sorry for the confusion I made.

However the WebView, the only native control we use, still rotates, and even worth it is locked 90 degree rotated when the Portrait Orientation Lock is enabled by user.
I’m still unconvinced that this is something Apple is to fix.

As for Unity, I read some blog article and tweets from developer that they say they fix specifically the Game Center issue, though it’s in Japanese and I couldn’t find English information about this.
http://akisute.com/2012/09/unity-355-game-center-iad-uiimagepicker.html [import]uid: 132466 topic_id: 31056 reply_id: 126213[/import]

Add my name to list of people who need a fix! As with others who are using landscape mode, I think that restricting orientation to Landscape right will not go down well with reviewers and users, particularly on the iPad.

So it seems we have a choice: do not support Game Center and get scored down for not supporting it, or do not support the standard orientations, and get scored down!

Great support, Corona team so far, but we need a fix!!

Maybe I’m over-simplifying the issue, but I cannot see why portrait mode cannot be restricted from available orientations, except when game center is invoked.

Anthony [import]uid: 87194 topic_id: 31056 reply_id: 126479[/import]

I also need a fix for the orientation stuck in only 1 orientation. I just released a game yesterday and got a 1-star review just because it doesn’t rotate!! [import]uid: 144908 topic_id: 31056 reply_id: 126493[/import]

Tossing that through Google Translate, it looks like they’re explaining the bug, but they haven’t fixed it either.

Would it be possible to include this fix if Corona detects that only landscape options are listed in build.settings?

https://devforums.apple.com/message/731764#731764 [import]uid: 105445 topic_id: 31056 reply_id: 126287[/import]

bfintal,

Exactly my point.
Come on, Corona, don’t hide behind Apple! Apply some resource here because we know you can fix it! How many great apps will be on hold until we have a fix?

Anthony [import]uid: 87194 topic_id: 31056 reply_id: 126506[/import]

We had our iOS engineer spend two days on this and looked at all the options and there is no general purpose solutions that works. We can do it using private Apple APIs but that will be rejected if you try to submit the app to the App store. My FAQ blog post for this week talks about this issue.
http://www.coronalabs.com/blog/2012/10/03/faq-wednesday-ios6-bugs/

Everyone needs to file a bug report with Apple so this gets fixed ASAP. [import]uid: 7559 topic_id: 31056 reply_id: 126308[/import]