Screenshots and new iPhone size compatibility

hey folks, while we are waiting for Rob’s official input, I did found a way to include these information in the build.settings file and have some success…

I can only speak for build 2393a though, but hope these information help:

App Icons (doc is updated with iOS8 info)

http://docs.coronalabs.com/guide/distribution/buildSettings/index.html#appicons

http://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/IconMatrix.html

From the Corona docs above, I believe there might be one additional icon missing; which is the Search/Settings @3x icon. Or  Icon-Small-40@3x.png

So to accommodate the new phones with icons, just three additional files: 

Icon@3x.png, Icon60-@3x.png, Icon-Small@3x.png, Icon-Small-40@3x.png

(see post #266586 for naming correction between Icon@3x.png vs Icon-60@3x.png )

Including / Overriding Launch Images ( UILaunchImages ) using plist from build.settings :

(background information)

http://stackoverflow.com/questions/25926661/how-do-i-create-launch-images-for-iphone-6-6-plus-landscape-only-apps

I can confirm including UILaunchImages in build.settings does override Corona’s SDK / iOS default launch image lookup, and does not interfere with iOS 6 or earlier.

Here is my example that worked on my two iOS8 devices (iPod Touch 5th Gen + iPad 2); theoretically it should work with new iPhone 6/6+ … so please give it a go to find out.

settings = { iphone = { plist = { UILaunchImages = { { -- iPhone 4/4S ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "MyNewLaunchImage-Portrait", ["UILaunchImageOrientation"] = "Portrait", ["UILaunchImageSize"] = "{320, 480}" }, { -- iPhone 5/5S ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "MyNewLaunchImage-Portrait", ["UILaunchImageOrientation"] = "Portrait", ["UILaunchImageSize"] = "{320, 568}" }, { -- iPad / iPad Retina ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "MyNewLaunchImage-Portrait", ["UILaunchImageOrientation"] = "Portrait", ["UILaunchImageSize"] = "{768, 1024}" }, { -- iPhone 6 ["UILaunchImageMinimumOSVersion"] = "8.0", ["UILaunchImageName"] = "MyNewLaunchImage-Portrait", ["UILaunchImageOrientation"] = "Portrait", ["UILaunchImageSize"] = "{375, 667}" }, { -- iPhone 6 Plus ["UILaunchImageMinimumOSVersion"] = "8.0", ["UILaunchImageName"] = "MyNewLaunchImage-Portrait", ["UILaunchImageOrientation"] = "Portrait", ["UILaunchImageSize"] = "{414, 736}" }, } } } }

You can read the full information at the stackoverflow link above, or at Apple’s plist guide here:

http://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html#//apple_ref/doc/uid/TP40009252-SW28

In my test project directory,  I included two sets of launch image files which got picked up differently depending on the device;  UILaunchImages  only applies to iOS7 or later devices so the above settings only applied to the newer iDevices. If app is installed on an older device, it will use the old settings which is to look for “Default.png” or “Default@2x.png” at launch.

@newbieLUA

Theoretically it should work, however I’ve seen that landscape only apps have issues displaying the correct splash screen.

Sometimes only a black screen is displayed. This black screen issue must be an Apple bug (I’ve reported it). The only way around the bug I know of is to use the new Xcode Launch Screen File feature. But only Enterprise users can implement that (at the moment).

Also (to be picky) the iPhone 6 / 6 Plus only need a [“UILaunchImageMinimumOSVersion”] = “8.0”

@ingemar, thanks for catching the UILaunchImageMinimumOSVersion bit, fixed it :slight_smile:

From the stackoverflow link above, the person mentioned it worked by applying an extra entries to the UILaunchImages key (iOS8 GM), do you think it may still work for now or it’s officially broken at this point?

Giving it an “Landscape” orientation, and then specifying portrait {width , height} dimensions

\<dict\> \<key\>UILaunchImageMinimumOSVersion\</key\> \<string\>7.0\</string\> \<key\>UILaunchImageName\</key\> \<string\>Default\</string\> \<key\>UILaunchImageOrientation\</key\> \<string\>Landscape\</string\> \<key\>UILaunchImageSize\</key\> \<string\>{320, 480}\</string\> \</dict\> \<dict\> \<key\>UILaunchImageMinimumOSVersion\</key\> \<string\>7.0\</string\> \<key\>UILaunchImageName\</key\> \<string\>Default-568h\</string\> \<key\>UILaunchImageOrientation\</key\> \<string\>Landscape\</string\> \<key\>UILaunchImageSize\</key\> \<string\>{320, 568}\</string\> \</dict\> \<dict\> \<key\>UILaunchImageMinimumOSVersion\</key\> \<string\>8.0\</string\> \<key\>UILaunchImageName\</key\> \<string\>Default-667h\</string\> \<key\>UILaunchImageOrientation\</key\> \<string\>Landscape\</string\> \<key\>UILaunchImageSize\</key\> \<string\>{375, 667}\</string\> \</dict\> \<dict\> \<key\>UILaunchImageMinimumOSVersion\</key\> \<string\>8.0\</string\> \<key\>UILaunchImageName\</key\> \<string\>Default-736h\</string\> \<key\>UILaunchImageOrientation\</key\> \<string\>Landscape\</string\> \<key\>UILaunchImageSize\</key\> \<string\>{414, 736}\</string\> \</dict\> \<dict\> \<key\>UILaunchImageMinimumOSVersion\</key\> \<string\>7.0\</string\> \<key\>UILaunchImageName\</key\> \<string\>Default-Landscape\</string\> \<key\>UILaunchImageOrientation\</key\> \<string\>Landscape\</string\> \<key\>UILaunchImageSize\</key\> \<string\>{768, 1024}\</string\> \</dict\>

^ or the equivalent translation applied into build.settings

… from stackoverflow regarding iPhone 6 Plus launch image …

All iPhone launch images need to be rotated into portrait orientation as usual EXCEPT for the iPhone 6 Plus launch image. It natively supports landscape orientation launch images, so you need to leave it’s launch image in landscape orientation.

That might work, however I’ve already switched over to using a Launch Screen File.
It allows you to only have *one* file for all devices. Very clean. (requires devices with iOS 8 though)

Just wish they had implemented the same thing for the app icon (maybe in iOS 9) :slight_smile:

ahh okay, yes sound much better having to deal with just 1 file rather than a million of them  :)  :)  :)  :slight_smile:

I’m seeing some surprising behavior for the iPhone 6+. Can someone confirm that I’m thinking of this correctly…

I use pixelWidth and pixelHeight for all my placement. On iPhone 6+, display.pixelWidth returns the surprising value of “834”. The physical width (in real pixels) of the 6+ is 1080 pixels, while the “virtual” size is 1242 (for the rather complicated reasons explained quite well here: http://www.paintcodeapp.com/news/iphone-6-screens-demystified).

834 seemed a bit out of place. However, it is quite close to 2x the “points” width of the display, which is 414. Although I did have to change my calculations of dots per inch (which I use to maintain some control over the physical size of the fonts to make sure text is readable) to match a fake 310 dpi (834 pixels/2.69") vs the real dpi of 401, it had the surprising benefit that I didn’t have to change my “scaling” factor to convert pixels to points when using native text inputs, because at the reported pixelWidth, the point-to-pixel mapping is still 2:1 (~834:414), as opposed to the 3:1 mapping of points that I would have had to use at full 6+ resolution (i.e., 1242:414).

So, my questions are:

  1. Why 834 rather than 414x2 = 828?

  2. Is this a bug or a feature? Is it slated to continue like this (i.e., can I rely on this same behavior in the future)?

  3. Am I thinking about it all wrong, and could this be some artifact of not using the proper launch images yet? Does using a launch image of a certain size cause the phone to “mimic” resolutions?

Other details:

  • This is built for iOS7, not iOS8 (sorry, I can’t test for 8 because I’ve been having the error #5 problem).

  • As mentioned, I’m still using the launch images from previous builds, not images targeting iOS8 or iPhone 6/6+.

  • I’ve only tested on 6+. I haven’t had access to iPhone 6. But these issues do seem to be rather specific to the 6+.

  • I only had a couple of hours to play with the 6+, so unfortunately I don’t have the corresponding values for pixelHeight, but I would imagine they are correctly scaled to match, as everything else in my app just worked.)

…how about display.contentWidth & display.contentHeight ? 

What kind of number does your device return ?

Actually nevermind that one, it is a variable set in config. But 834px is a very odd number being reported, but I think it should be a temporary problem.

Once iOS 8 detects a proper launch image “-667h@2x.png” or “-736h@3x.png”, then it should render the rest of the app correctly and reporting the correct number of pixels … this was mentioned by @dfoxinator on the regular iPhone 6 with a tweaked Info.plist

@vo1
If you don’t use launch images specifically for the iPhone sixes, the app will end up in “scaling mode”. It will take the iPhone 5 resolution and scale it up.

Also, when using Corona I see no need to use pixelWidth/pixelHeight to position things. I guess you have your reasons, but I’d recommend just letting Corona do the calculations for you, and use contentHeight/contentWidth together with your preferred scaling mode in config.lua.

I’ve made some progress tonight.  I can produce a build.settings that handles the default launcher images and icons.  It seems to position objects were I expect them.  I’m waiting on some additional tests, but @newbieLUA’s post above basically takes care of the default.png files.  The suggestions in our build guide on Icons is about right.  I’m going to have another tweak made to it.

Hopefully tomorrow night I’ll have something here to tease for an upcoming blog post.

Rob

Nice Rob. Looking forward to it.

Does anyone know what system.getInfo(“model”) returns for the iPhone 6 and 6+ ?

I have an app where I use that to determine what iOS device the app is running on, that I need to update.

@ingemar

Thanks for the insight on the launch images. I suppose that is actually useful behavior, although it would be nice to understand where the 834 px width comes from (it’s not clear to me how to derive it from a scaling of iPhone 5 resolution).

I wasn’t very clear in my description. I do use contentHeight/contentWidth for everything. It’s just that I set the dimensions in the build settings using pixelWidth and pixelHeight. I found that this prevents distortion due to varying aspect ratios (esp across Android devices), scales nicely with various resolution ranges and aspect ratios, and gives smoother animation (low res content sizes seem to result in transitions occurring in bulky “steps”). Or maybe I just never got properly used to the other (recommended) method. My preference might also be due to my using Corona for a business app (vs a game), where dynamic usage of screen for displaying more content is more important than the aesthetics of item relationships that are crucial in games. 

Anyway, that’s all off-topic, though it’s worth noting that the app would otherwise scale properly for 6+ in either method, and the font/dpi issue would be the same as well. 

Thanks also to @newbieLUA, for similar advice re launch images.

[…] My preference might also be due to my using Corona for a business app (vs a game), where dynamic usage of screen for displaying more content is more important than the aesthetics of item relationships that are crucial in games. […]

Makes sense  :slight_smile:

Shouldn’t “Icon@3x.png” actually be named “Icon-60@3x.png” since its dimensions are supposed to be 180x180 and not 171x171?

Reasoning:

Icon.png = 57x57

Icon@2x.png = 114x114

Icon-60.png = 60x60

Icon-60@2x.png = 120x120

hmm yes, you are right @Parthap Murthy, thanks for pointing that out !

So I believe Corona’s doc needs updating because their’s says “Icon@3x.png

First the name of the Icon doesn’t really matter.  As long as Icon@3x.png is a 180x180 you could name it Fred.png.  Apple reads that array from build.settings and finds icons that match based on size.  They really don’t care about the names unless you leave that array out of build.settings then the names matter.

However, I’ve already pinged Brent about updating the guide to use Icon-60@3x.png for the file to be consistent with the names we are using.  I’m still unclear about the new 120x120.  With the method we recommend for your build.settings, Apple should find your Icon-60@2x.png file as a 120x120 and when it looks for the @3x version of the 40x40, it should find the existing 120x120 and we shouldn’t need two copies of it.  I don’t have a good way of testing that yet, but I don’t see why Apple would force you to have two 120x120’s.

The system.getInfo(“model”) returns “iPhone” for all iPhones.   However what you’re looking for is system.getInfo(“architectureInfo”) which the 6 Plus is “iPhone7,1” and the iPhone 6 is “iPhone7,2”

@yo1, in my testing, I’m getting the right values on the iPhone 6 plus I’ve gotten to play with and I had someone run it on an iPhone 6 and got the expected values there.

Yes, Rob. It’s more about keeping the naming convention consistent than anything else. The naming convention has been consistent thus far, so no reason to deviate now.

hey Rob , sorry to add on more confusion to this icon madness … but I just found out (via simulator & actual iOS8 [not iPhone 6/6+] devices) , that having two 120x120 icons within the same bundle will cause trouble…

Please see screenshot below; basically iOS is pulling up iPhone 6 Plus’ search icon  Icon-Small-40@3x.png  and displaying it as the app’s main icon on @2x devices (home screen)!

On the other hand, having no  Icon-Small-40@3x.png in the bundle, iPhone 6 Plus (iOS Simulator) pulls up Icon-60@2x.png as the search icon and worked just fine…

So you were 100% right in the first place !

iOS will scan and pick up only one 120x120 icon and deal with it.

The more important issue is that we would end up displaying the search icon on the home screen for smaller phones. I’m sure 99% of folks here will use the same graphic anyways so it probably won’t matter, but just wanted to point that out and see if your team may want to investigate this further, update the docs again, or take note of that when preparing future documentations.

Thanks again!

I can see corona guide updated with following launch images for iPhone 6 and 6+ 

Default-667h@2x.png

Default-736h@3x.png

Default-736h@3x.png

Can someone from corona confirm that adding these files to base directory is enough for new iPhones compatibility Or i need to add any entries in my build settings too??

I am using public build 2393 and Xcode 5.1 .

Hi @tanu.kush,

The files for launch images never needed to be specified within “build.settings”, and I don’t believe anything has changed in that regard for iOS8. Simply put them in the base directory and it should be fine.

Best regards,

Brent