Hi Henrik.
Please bear with me. Apple has made this difficult and there is history involved.
When Apple came out with the iPhone 5, they needed a way to tell if an app was designed to use the taller screen (16:9) or if it was a legacy 3:2 device (i.e. 640x960). So being clever, their engineers decided they could extend their launch image system and decreed that you must have a file named Default-568h@2x.png. It has to be 640x1136, png with no transparency in portrait orientation. If Apple finds that folder, the device becomes a 640x1136 device instead of a 640x960.
Fast-forward two years when the iPhone 6 and 6 plus were released. Now using the Default-568h@2x.png file was sufficient to indicate tall mode, but the 6 and 6 plus were bigger screens. Apple added an iPhone 5 compatibility mode where the new phones would behave like an iPhone 5 so those apps would properly fill the screen. In addition in the App Store (and I don’t know if this is still true) they showed a label “Designed for the iPhone 6/6 plus”. They needed a way now identify which apps were designed specifically for the new screens. Following their pattern, they added Default-667h@2x.png which has to be 750x1134 in portrait mode and Default 736h@_ 3x _.png that’s 1242 × 2208 pixels in portrait mode.
I’m not sure if it was iOS 7 or 8 where this happened, but at some point, Apple kinda decided that this whole “Default” file business was getting out of control. Instead of them scanning the App bundle looking for Default* and trying to figure out which image goes with which, they added a large, difficult to manage table to their Info.plist table (for us that means build.settings). They added a new key UILaunchImage which has a table as its value. You can see an example here:
settings = { iphone = { plist = { -- Required launch image files/definitions table UILaunchImages = { { -- iPhone 4 Portrait ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default", ["UILaunchImageOrientation"] = "Portrait", ["UILaunchImageSize"] = "{320, 480}" }, { -- iPhone 4 LandscapeLeft ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default", ["UILaunchImageOrientation"] = "LandscapeLeft", ["UILaunchImageSize"] = "{320, 480}" }, { -- iPhone 4 LandscapeRight ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default", ["UILaunchImageOrientation"] = "LandscapeRight", ["UILaunchImageSize"] = "{320, 480}" }, { -- iPhone 5 Portrait ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default-568h", ["UILaunchImageOrientation"] = "Portrait", ["UILaunchImageSize"] = "{320, 568}" }, { -- iPhone 5 LandscapeLeft ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default-568h", ["UILaunchImageOrientation"] = "LandscapeLeft", ["UILaunchImageSize"] = "{320, 568}" }, { -- iPhone 5 LandscapeRight ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default-568h", ["UILaunchImageOrientation"] = "LandscapeRight", ["UILaunchImageSize"] = "{320, 568}" }, { -- iPad Portrait ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default-Portrait", ["UILaunchImageOrientation"] = "Portrait", ["UILaunchImageSize"] = "{768, 1024}" }, { -- iPad LandscapeLeft ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default-Landscape", ["UILaunchImageOrientation"] = "LandscapeLeft", ["UILaunchImageSize"] = "{768, 1024}" }, { -- iPad LandscapeRight ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default-Landscape", ["UILaunchImageOrientation"] = "LandscapeRight", ["UILaunchImageSize"] = "{768, 1024}" }, { -- iPhone 6 Portrait ["UILaunchImageMinimumOSVersion"] = "8.0", ["UILaunchImageName"] = "Default-667h", ["UILaunchImageOrientation"] = "Portrait", ["UILaunchImageSize"] = "{375, 667}" }, { -- iPhone 6 LandscapeLeft ["UILaunchImageMinimumOSVersion"] = "8.0", ["UILaunchImageName"] = "Default-667h", ["UILaunchImageOrientation"] = "LandscapeLeft", ["UILaunchImageSize"] = "{375, 667}" }, { -- iPhone 6 LandscapeRight ["UILaunchImageMinimumOSVersion"] = "8.0", ["UILaunchImageName"] = "Default-667h", ["UILaunchImageOrientation"] = "LandscapeRight", ["UILaunchImageSize"] = "{375, 667}" }, { -- iPhone 6 Plus Portrait ["UILaunchImageMinimumOSVersion"] = "8.0", ["UILaunchImageName"] = "Default-736h", ["UILaunchImageOrientation"] = "Portrait", ["UILaunchImageSize"] = "{414, 736}" }, { -- iPhone 6 Plus LandscapeLeft ["UILaunchImageMinimumOSVersion"] = "8.0", ["UILaunchImageName"] = "Default-Landscape-736h", ["UILaunchImageOrientation"] = "LandscapeLeft", ["UILaunchImageSize"] = "{414, 736}" }, { -- iPhone 6 Plus LandscapeRight ["UILaunchImageMinimumOSVersion"] = "8.0", ["UILaunchImageName"] = "Default-Landscape-736h", ["UILaunchImageOrientation"] = "LandscapeRight", ["UILaunchImageSize"] = "{414, 736}" }, { -- iPad Pro Portrait ["UILaunchImageMinimumOSVersion"] = "9.0", ["UILaunchImageName"] = "Default-Portrait-1366", ["UILaunchImageOrientation"] = "Portrait", ["UILaunchImageSize"] = "{1024, 1366}" }, { -- iPad Pro Landscape Right ["UILaunchImageMinimumOSVersion"] = "9.0", ["UILaunchImageName"] = "Default-Landscape-1366", ["UILaunchImageOrientation"] = "LandscapeRight", ["UILaunchImageSize"] = "{1024, 1366}" }, { -- iPad Pro Landscape Left ["UILaunchImageMinimumOSVersion"] = "9.0", ["UILaunchImageName"] = "Default-Landscape-1366", ["UILaunchImageOrientation"] = "LandscapeLeft", ["UILaunchImageSize"] = "{1024, 1366}" }, }, }, }, }
You pretty much have to match this exactly. With iOS 9, only the plus model phones supported landscape. In iOS 10 that’s still the case, but it seems you’re required to still include landscape entries in the table that points to the vertical image.
iOS 10 brought two new changes to light:
-
Apple wants you to stop using static images. They have made this painful to do.
-
There are not many 3:2 iPhone 4 shaped devices out there. They therefore have increased enforcement of the Default-568h@2.png file. In other words, if that file isn’t there or you’ve not moved to the modern way Apple wants you do this, you will get rejected. Luckily it’s a rejection that happens in minutes when they scan the app bundle for issues.
Apple would prefer you abandon static launch images and adopt their Xcode Storyboard based method. Which for people who never use Xcode, this seems more daunting than static images, but I can tell you it’s not and it’s worth switching.
Before I get to the Storyboard method, let me be explicitly clear about one thing.
This is not a Corona thing. We show our Corona Splash Screen (or your custom one) only after your app has launched and we gain control over it. Android has never had the concept of a launch image. It worked previously because on Android builds, we were pretty much doing what we do with the Splash Screen control today, only that the old version only looked for Default.png or Default@2x.png and stretched it to fill the device. So we have this work flow:
Apple: Launch Image -\> Corona Splash Screen -\> Your first screen Android: Corona Splash Screen -\> Your first screen
The Apple launch image is processed well before we get control. So let’s talk storyboard (the Xcode kind, not our retired scene manager)
If you want to use the modern method (available with iOS 8 and later), you can either:
-
Copy the LaunchScreen.storyboardc file from any of our sample projects and add one line to your build.settings file. This will result in you getting an all black launch screen which will transition to the Corona Splash Screen control. You need not additional files.
-
Follow this guide: https://docs.coronalabs.com/guide/distribution/launchFile/index.html and create your own custom Storyboard. We provide a default starting project for this that you can download, double click on the project file and get going.
-
Follow the guide. Download the project, but instead of customizing it and if a black background is acceptable, then simply export the default storyboard to create a LaunchScreen.storyboardc file then provide three images. I recommend a 512x512 named Launch.png, a 1024x1024 named Launch@2x.png and 1536x1536 named Launch@3x.png and drop those and the .storyboardc file into the folder with your main.lua and follow the changes to build.settings (needs one new line of code and removing the old static style table).
If you need something other than black, you can modify the Storyboard in Xcode. Of course you may want a white background or you want more elements that a square image. In which case you should follow the whole guide. But this is seriously a better method going forward and is Apple’s current desired way to do this. Consider the new build.settings:
settings = { iphone = { plist = { CFBundleIconFiles = {}, -- Required! UILaunchStoryboardName = "LaunchScreen", -- Required! Only one line!!! }, }, }
Isn’t that a much more pleasant build.settings? Isn’t three files named Launch.png, Launch@2x.png and Launch@3x.png way better than nearly a dozen files that have to be specific sizes and have hard to remember names like Default-568h@2x.png?
Rob