Supporting iPhone 5 via config.lua. Still need the tall splash image?

Okay so the next game I’m releasing supports iPhone 5 and iOS6. I have my config.lua file all set up and the UI elements are aligning up properly. The config.lua accommodates all the (recent) iOS devices: iPad, iPad retina, iPhone 3gs, iPhone 4 and iPhone 5:

EDIT: simpler and takes into account the new iTouch dimensions
[lua]-- For iPads
if system.getInfo(“model”) == “iPad” or system.getInfo(“model”) == “iPad Simulator” then

application = {
content = {
width = 360,
height = 480,
scale = “zoomEven”,
audioPlayFrequency=“44100”,
fps = 30,

imageSuffix = {
["@2x"] = 2,
["@4x"] = 4,
}
}
}

– For “tall” sizes (iPhone 5 and new iTouch)
elseif display.pixelHeight > 960 then

application = {
content = {
width = 320,
height = 568,
scale = “zoomEven”,
audioPlayFrequency=“44100”,
fps = 30,

imageSuffix = {
["@2x"] = 2,
}
}
}

else – For traditional sizes (iPhone 4S & below, old iTouch)

application = {
content = {
width = 320,
height = 480,
scale = “zoomEven”,
audioPlayFrequency=“44100”,
fps = 30,

imageSuffix = {
["@2x"] = 2,
}
}
}

end[/lua]

So with this, the app is doing fine in the simulator and my devices (no iPhone5 yet)

My question is, do I still need that “tall” splash image Default-568h@2x.png I read in the Corona blog to support the tall mode?? [import]uid: 144908 topic_id: 31095 reply_id: 331095[/import]

I believe you do. Without it, the iPhone’s OS will think that the app does not support the full resolution. [import]uid: 160496 topic_id: 31095 reply_id: 124295[/import]

Hmm weird. Last 2 questions, will that image be shown? And when will it be shown? [import]uid: 144908 topic_id: 31095 reply_id: 124296[/import]

From what I gathered, yes, it will be shown, as a “splash” image as your app starts up (like the other default images were shown before iPhone 5) [import]uid: 160496 topic_id: 31095 reply_id: 124302[/import]

Oh yea I forgot about that splash image from back in the day in native non-Corona apps. Thanks mike470, I guess I’ll just put a black screen with a small “please wait” message since there will be an actual loading screen in our apps.

Alright now I guess my app is iPhone5 and iOS6 ready! [import]uid: 144908 topic_id: 31095 reply_id: 124308[/import]

How come system.getInfo(“model”) doesn’t say “iPhone” if it’s a 4S or below. It does on my version of Corona (latest public build).

Dave [import]uid: 117617 topic_id: 31095 reply_id: 124321[/import]

It does! Or rather, I just do a catch-all for iPhones with the ‘else’ statement as with my config.lua above [import]uid: 144908 topic_id: 31095 reply_id: 124322[/import]

It was your comment -

else – iPhone 4S and below

That confused me, as I thought iPhone 4S would never hit that else statement.

Dave [import]uid: 117617 topic_id: 31095 reply_id: 124324[/import]

Ah, iPhone 4S will hit the else statement since the previous elseif is pixelheight > 960 which is only for iPhone5 (got that snippet from Corona’s blogpost) [import]uid: 144908 topic_id: 31095 reply_id: 124329[/import]

Sorry, I see that now, it’s wrapped on my screen so didn’t even notice the last bit of the if/and statement.

Dave [import]uid: 117617 topic_id: 31095 reply_id: 124333[/import]

No worries Dave :slight_smile: [import]uid: 144908 topic_id: 31095 reply_id: 124334[/import]

This is good stuff. Thank you! Should be posted in the Code Exchange so it doesn’t get buried in the forums. [import]uid: 6084 topic_id: 31095 reply_id: 124360[/import]

One omission in that code is that you check for ‘iPhone’ and not ‘iPod Touch’. It was a much smaller announcement, but a ‘Tall’ iPod Touch was also announced, and so it should be caught with the iPhone 5 sizings.

[import]uid: 134101 topic_id: 31095 reply_id: 124363[/import]

@ntero is there a getInfo(“model”) == “iPod” ? I always assumed the ipod was interchangeable with iphone since the dimensions of the two were always similar. [import]uid: 144908 topic_id: 31095 reply_id: 124374[/import]

The Syntax I get from iPod Touches for model is: ‘iPod Touch’
They count as different models, since they have different capabilities and specs, since the model isn’t strictly for resolution. [import]uid: 134101 topic_id: 31095 reply_id: 124375[/import]

Thats good to know! I definitely did not know that. That should be added to the elseif statement. Thanks! [import]uid: 144908 topic_id: 31095 reply_id: 124377[/import]

You could incorporate some of my code from iOSInfo to get a quicker determination: Take a closer look:

http://developer.coronalabs.com/code/iosinfo-definitive-way-determine-type-ios-device-your-app-running

Basically, the system.getInfo(“architectureInfo”) could give you “iPod5,1” and “iPhone5” as a possible result for the iPod touch 5G and iPhone 5, respectively.

This article (http://techland.time.com/2012/04/09/iphone-and-ipod-touch-rumors-collide-in-apple-rumorpocalypse/) shows “iPod5,1” being returned as a result in some benchmarks and analytics. [import]uid: 6084 topic_id: 31095 reply_id: 124378[/import]

I changed the config.lua above. I’m mostly interested in the dimensions (I think some of you are too) so the above config file takes mostly that into consideration :slight_smile: [import]uid: 144908 topic_id: 31095 reply_id: 124380[/import]

@BeyondtheTech Nice, that’ll definitely be helpful in determining device features, thanks for pointing that out! [import]uid: 144908 topic_id: 31095 reply_id: 124382[/import]

If you don’t include the “tall” splash png, iOS6 will return 960 for display.pixelHeight. It defaults to the iPhone Retina display (640x960) without the new splash png. [import]uid: 7559 topic_id: 31095 reply_id: 124405[/import]