Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Unity How to add a launch-screen storyboard for iOS in Unity - App Store requirement by June 30, 2020

Discussion in 'iOS and tvOS' started by JC-Cimetiere, Mar 18, 2020.

  1. JC-Cimetiere

    JC-Cimetiere

    Unity Technologies

    Joined:
    May 8, 2014
    Posts:
    102
    UPDATE: deadline is extended to June 30, 2020 (see https://developer.apple.com/news/?id=03262020b)
    This document provides information, instructions, and examples for how you can meet Apple’s App Store requirement to use a launch-screen storyboard for all app updates and submissions as of April 30, 2020.

    The new App Store requirements
    Apple will require all apps submitted to the store to have their launch screen (splash screen) built using a proprietary Apple storyboard file. Until now, users have been able to specify a single image or an Apple xib file that Unity handles automatically during player build, inserting it in the correct places in Xcode.
    If you are not currently using a storyboard file for your launch screen, you must upgrade before the April 30 deadline.
    To create a storyboard file, you need to use Xcode, and therefore a Macintosh computer.

    Unity support for storyboard files
    Unity 2017.4, 2018.4, and 2019.3 support the use of storyboard files as launch-screen images, however, they do not create them for you. As well, note the following:
    • The “Use Storyboard for Launch Screen” option in Unity’s iOS player settings is not selected by default.


    • For Unity, you need to create the storyboard in Xcode, and then you have to copy it (with any necessary images) into your Unity project.
    • Unity will build your specified launch-screen storyboard into an Xcode project, but it will not copy any referenced image assets across automatically unless you put them in the StreamingAssets folder.
    • Unity’s built-in Splash Screen (mandatory for Personal Edition) is not affected by this update. The launch-screen storyboard appears before the Unity Splash Screen (if you have enabled it).
    We are working on making the launch-screen storyboard as default and improving the overall workflow. For now, see the details below.

    Setting up a storyboard in Unity
    There are two methods you can use to set up your storyboard:
    • Method 1: Copy, link, and reference an existing launch-screen storyboard and assets within the Xcode project, either manually or using automated means, after the project has been built.
    • Method 2: Add the storyboard file to your Unity project and place any referenced images in the StreamingAssets folder. Unity treats these as raw assets so it will copy and link them to Xcode and use them in the storyboard.
    Method 2 lets you keep the storyboard and images within the Unity project, therefore they are checked into source control. This method leverages Unity’s ability to build the storyboard into an Xcode project and it ensures that images you place in the StreamingAssets folder get copied across too.

    This document assumes that a launch-screen storyboard already exists, created on a Macintosh, and all the required images are available. The easiest way to create a launch-screen storyboard in Xcode is to start with a new blank project, work on the launch-screen storyboard in it, then copy the storyboard file and images into your Unity project (this also allows the project to be checked into source control).

    Once you have created a simple Xcode project you can edit the LaunchScreen.storyboard, using a splash.png image which you can adjust to scale to fit for example:


    In Finder, the project structure would look like the following (we’ve selected the assets of interest).


    Copy the LaunchScreen.storyboard file to your Unity project. If you don’t have a StreamingAssets folder in your Assets folder, then create it and copy any images in there.



    Now, in the iOS player settings, select Use Storyboard for Launch Screen and browse to the LaunchScreen.storyboard file. Remove any other splash images you may already have.



    NOTE: Restart Unity at this point because it may still have the old splash assets cached.

    You can now build your iOS project. When you’re finished, open Unity-iPhone.xcodeproj in Xcode and you should see the storyboard file. The images should be in the Unity-iPhone/Data/Raw/ directory. When you select the storyboard file, you should see it with the images. For example:

    Confirm that the Unity-iPhone target has the Launch Screen File set to the correct storyboard. For example:


    In order for the splash screen images to be copied to the device there are a few final steps.
    In the Unity-iPhone build target, select the “Build Phases” tab and open “Copy Bundle Resources”


    Click the + button to add a new item(s) to “Copy Bundle Resources” and select “Add Other”


    Browse to the "{xcode project}/Data/Raw” directory, select your splash images and click “Open”


    Check the options match the above and click “Finish”


    Note your image(s) will be added to “Copy Bundle Resources”. This ensures that the splash screen images are installed onto the device correctly.

    Other resources
    See also the Xcode Storyboard option for Splash Screens forum post (thank you @Marat_Gilyazov) which includes a link to a complete tutorial on how to make a launch screen storyboard.
     
    Last edited: Mar 27, 2020
  2. BrunoGaspar

    BrunoGaspar

    Joined:
    Sep 28, 2012
    Posts:
    2
    Hi,

    Unfortunately we still have projects on Unity 5.5, what are our options regarding this? Any chance we implement this support by ourselves using Unity5.5? any advice?

    Thank you in advance.
     
  3. tonemcbride

    tonemcbride

    Joined:
    Sep 7, 2010
    Posts:
    952
    JC-Cimetiere likes this.
  4. JC-Cimetiere

    JC-Cimetiere

    Unity Technologies

    Joined:
    May 8, 2014
    Posts:
    102
    Hi
    You might be able to hack the Xcode project exported by Unity and reference an existing launch-screen storyboard within the Xcode project, but since Unity 5.5 support ended long ago we won't be able to go back, try or verify or help. Sorry.
    The more future proof option is to upgrade to 2017LTS (although support will end this year) or 2018 LTS.
    JC
     
  5. yuriythebest

    yuriythebest

    Joined:
    Nov 21, 2009
    Posts:
    1,029
    Hi JC-Cimetiere!
    If I have older apps ( made with unity 5x), does unity logo use the storyboards?
     
  6. Mr-Oliv

    Mr-Oliv

    Joined:
    Sep 14, 2012
    Posts:
    26
    @JC-Cimetiere Thanks for this! I followed Marat's tutorial (and his script) and got it to work right away by building through XCode. But then I tried uploading the project to Unity's cloud build and the storyboard splash screen got lost somewhere in the process. Is there anything I can do to make it work?
    Thanks
    M
     
  7. In2Play

    In2Play

    Joined:
    Apr 25, 2016
    Posts:
    20
    Probably not and you can easily tell the difference.

    Apple Storyboards: When you tap any app that uses storyboards, it will show the icon of that app (or whatever file image is used in storyboards - usually it's app's icon) right away in an instant. I believe that Apple is enforcing this because it wants the user to feel "native" and gives the impression that Apple product is good quality, responsive etc.

    Unity Logo: When you open the app the "black screen" appears for a moment and then you can see Unity Logo (it seems that Unity logo is loaded somewhere in the "middle" of launching the app - before opening your project, but after the storyboards).

    In a nutshell: If you never used your own storyboards in a Unity then its very likely that your project does not contain Storyboards file and your app won't go through a review after June 30.
     
    Last edited: Mar 31, 2020
    protopop likes this.
  8. yuriythebest

    yuriythebest

    Joined:
    Nov 21, 2009
    Posts:
    1,029
    Ok, I upgraded my project to unity 2018.4.01 and checked the "use storyboard for launch screen" option in the splash section in the player settings. However, when I build 'n launch the app, it's still the same as before with the "black screen" before the unity logo.

    Is my understanding correct that what I did is not enough, and that I'm required to make/add a custom storyboard for this to work? I previously just had the unity logo and no personal splash screen.

    Screen Shot 2020-04-03 at 16.01.59.png Screen Shot 2020-04-03 at 15.48.49.png
     
  9. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    7,065
    Why are you guys always so late with these things? Why are you always behind to support stuff like that and we mobile developers are always rushed into last minute changes and trying to find workaround.

    Storyboards have been around for a while, and your support has been super buggy forever.

    And even now: Using storyboard as a launch screen makes the launch screen fade to grey before loading the next scene. It's this bug here : https://issuetracker.unity3d.com/is...board-launch-screen-and-the-first-unity-scene

    You might read that and think, oh, I can just delete .storyboard in info.plist and that will fix the issue. And it does, BUT IT MAKES THE ORIENTATION ISSUE COME BACK.

    It has been years and still you can't figure out a simple way to let us have a professional looking splash screen. Stop dragging your feet.
     
  10. Dmitry-Pyalov

    Dmitry-Pyalov

    Joined:
    Dec 13, 2011
    Posts:
    99
    Do storyboards actually work in Unity? Or only on paper.
    When I tried Unity's option - it didn't work unless you explicitly named the storyboard "LaunchImage" - no custom names for you :)
    And as AcidArrow stated - the storyboard then faded to grey - you need to patch-out some Unity's Obj-C code to make it work.

    Is any of this fixed now? Sorry, I have no spare time to test things out.
     
  11. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    7,065
    Only on paper. But also controller support with input manager is broken for both iOS and tvOS, so at this point storyboard fading to grey seems like a minor issue.
     
  12. Dmitry-Pyalov

    Dmitry-Pyalov

    Joined:
    Dec 13, 2011
    Posts:
    99
    Yeah, we also have controller issues, that are still not fixed in 2019.3.10 (my bug report is not even confirmed by Unity). Thank god, it is possible patch those issues in Obj-C or remap some of the buttons in Rewired.
     
    Time-Jockey likes this.
  13. yuriythebest

    yuriythebest

    Joined:
    Nov 21, 2009
    Posts:
    1,029
    Using unity 2018.4.1, the storyboard works ( I create it using xcode and add it to my unity project), however I still get a warning when building about the lack of storyboard. HOWEVER, in the actual app, everything works fine - the storyboard instantly appears when launching the app, then the unity logo, then the app

    Launch images are deprecated in iOS 13.0. Use a launch storyboard or XIB instead
    Screen Shot 2020-04-30 at 10.57.36.png


    ==> Anyone know if this will be an issue when the deadline comes? will apple auto-detect these warnings and think the apps are non-compliant?
     
  14. stevenchan_playstudios

    stevenchan_playstudios

    Joined:
    Mar 1, 2017
    Posts:
    33
    Using unity 2019.2.21, the project is set to use landscape only.
    When the device is hold in portrait and open the app for the first time, the launch screen storyboard's imageview is shown as landscape (correct orientation). However, if you close it and open it again (kept device in portrait), the imageview is sometime autorotate or the main scene will become portrait mode.
     
    victorzh likes this.
  15. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    7,065
    Yeah, variations of this issue have been an issue for years with Unity's implementation.

    I just want to note:

    We are past the original April deadline.Current builds of Unity have issues with storyboards and also have broken controller support for iOS and tvOS.

    If Apple hadn't pushed back the deadline, we'd all be F***ed by Unity's chronic dragging of feet.
     
  16. Time-Jockey

    Time-Jockey

    Joined:
    Oct 11, 2012
    Posts:
    13
    I gave up waiting for a fix too - I've written way more native controller/tvos remote bindings than I ever wanted to.
     
  17. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,397
    This whole issue has me terrified. I’m on a great update cycle with Wilderless on iOS and I’m worried this will bring it to a halt. I’m also on unity 2019.2 so I’m not even sure a fix will come.

    I don’t really have much to say except I wish there wasn’t always these kind of scary updates lurking over the horizon so often. For me it’s yhe worst out of game design and I try to mitigate it though production planning but it’s really tough.

    I’m gonna get my next update up and then try to make sure I understand what we need tontonnd get it all prepped so I won’t be stuck unable to update.
     
  18. SofielafeeStudio

    SofielafeeStudio

    Joined:
    Mar 26, 2018
    Posts:
    12
    is the storyboard integration expected for 2019.4?
     
  19. homenetgames-jacek

    homenetgames-jacek

    Joined:
    Jun 8, 2015
    Posts:
    12
    If someone wants to remove that warning, solution is here: https://forums.macrumors.com/thread...-message.2201424/?post=27799290#post-27799290
    "Look for Asset Catalog Launch Image Set Name under Asset Catalog Compiler - Options. If I set that previously unset value to a random string in my project, it throws the same compile-time error you mentioned. Try clearing that setting."

    you can do it from postprocess in Unity:

    Code (CSharp):
    1.  
    2. private static void PrepareProject(string buildPath)
    3.     {
    4.         string projPath = Path.Combine(buildPath, "Unity-iPhone.xcodeproj/project.pbxproj");
    5.         PBXProject project = new PBXProject();
    6.         project.ReadFromString(File.ReadAllText(projPath));
    7.         string target = project.TargetGuidByName("Unity-iPhone");
    8.  
    9.          project.SetBuildProperty(target, "ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME", "");
    10.  
    11.         File.WriteAllText(projPath, project.WriteToString());
    12.     }
    13.  
     
    protopop likes this.
  20. MoribitoMT

    MoribitoMT

    Joined:
    Jun 1, 2013
    Posts:
    301
    Hello.

    What will happen to existing apps they are not updated?

    I have couple of old apps, however I will update them in 2020 August due to some reasons. Will apple remove the apps from market?
     
  21. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,397
    Old apps will stay on the store. The storyboard requirements are only for new apps and app updates. So you will need to add the storyboard when you update your apps in August.
     
    MoribitoMT likes this.
  22. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,525
  23. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,525
    @JC-Cimetiere why is the path to the storyboard stored as an absolute path? This means I cannot put it outside the Unity project as the path is then specific to my Mac and won't work for my colleagues. It should be stored as a relative path to the project surely?
     
    Moonjump likes this.
  24. kaarloew

    kaarloew

    Joined:
    Nov 1, 2018
    Posts:
    197
    At least in my ProjectSettings.asset it is relative
    Code (CSharp):
    1. iOSLaunchScreenCustomStoryboardPath: Assets/LaunchScreen.storyboard
     
  25. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,525
    It is if inside the project. Try having it outside of the Unity project.
     
  26. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,525
    Has anyone noticed that once you start using a storyboard for the launch screen the status icons are displayed briefly part way through the launch? This didn't happen previously.

    IMG_0785.jpg
     
  27. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,406
    >> Has anyone noticed that once you start using a storyboard for the launch screen the status icons are displayed briefly part way through the launch? This didn't happen previously.

    well thats because it wasnt storyboard before. Alas before ios13 storyboards didnt allow customizing view controller and it was allowing showing status bar. We did implement ios13+ fix (we make sure storyboard uses unity viewcontroller, making it work with orientation restrictions as a side-effect) and we are in the process of backporting it, so expect it to be fixed soonish (again - on ios13+)
     
  28. millar5001

    millar5001

    Joined:
    Feb 13, 2017
    Posts:
    23
    Not tried it yet but just wondering are their any problems adding story boards when using Unity cloud build?
     
  29. Kujo87

    Kujo87

    Joined:
    Sep 16, 2013
    Posts:
    127
    Hi,

    I've just stumbled across this while looking for another iOS issue and didn't really know anything about it.

    Does this only apply if you have a splash screen? We are a Plus user and so have the splash screens turned off? If this is still a requirement, how does it work with Cloud Build, as these solutions seem to be directly manipulating the xcode project?

    Thanks
     
  30. tonemcbride

    tonemcbride

    Joined:
    Sep 7, 2010
    Posts:
    952
  31. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    7,065
    Apparently it can only be fixed in iOS 13, which has been available only for almost a year, which isn't enough time for Unity to do anything.
     
  32. PixelEnvision

    PixelEnvision

    Joined:
    Feb 7, 2012
    Posts:
    497
    Try setting UIViewControllerBasedStatusBarAppearance to NO in plist, even if it logs deprecated message, that seems to help.
     
    andymads likes this.
  33. Moonjump

    Moonjump

    Joined:
    Apr 15, 2010
    Posts:
    2,398
    This isn't about the splash screen. It is the launch screen you see before that. So it does apply to Plus and Pro users.
     
  34. Kujo87

    Kujo87

    Joined:
    Sep 16, 2013
    Posts:
    127
    Thanks for the clarification. Sorry for the misunderstanding, with it talking about launch screen and what you can set for those, I thought it was splash.

    So at the moment, the only way to fix this is by externally editing the project - not through cloud? That's incredibly frustrating!
     
  35. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,525
    You can also refer to this post that was given in the initial post. It was a lot more straightforward - no manual post build steps needed. That's how I'm doing it but I don't know about via Cloud.
     
    protopop likes this.
  36. Kujo87

    Kujo87

    Joined:
    Sep 16, 2013
    Posts:
    127
    Awesome - thank you, I'll take a look. He says in there that cloud works too, so I'll give it a go!

    Shame its not something Unity can do automatically like they did previously
     
  37. tessellation

    tessellation

    Joined:
    Aug 11, 2015
    Posts:
    237
    If anyone is supporting multitasking on iPad, you may get an error when uploading your app archive to the App Store:

    ERROR ITMS-90476: "Invalid Bundle. Your app supports Multitasking on iPad, so you must include the launch storyboard file, 'LaunchScreen.storyboard', in your bundle, 'com.yourdomain.YourApp’."

    However, we do have a LaunchScreen storyboard. Many developers online suggest changing the Info.plist
    UIRequiresFullScreen to true and UIRequiresFullScreen~ipad to false, but the error is actually triggered because Unity is setting the wrong value for UILaunchStoryboardName. It should be "LaunchScreen" not "LaunchScreen.storyboard"

    I believe the above error is triggered because the validator expects to find "LaunchScreen.storyboard.storyboard" in the bundle, but it doesn't exist. @Alexey maybe look into fixing this? Change Unity so that it only takes the name of your custom storyboard file and not the extension also.
     
    ArtyBrest likes this.
  38. lucasholucasho

    lucasholucasho

    Joined:
    Aug 9, 2017
    Posts:
    2
    According to OP, "Unity’s built-in Splash Screen (mandatory for Personal Edition) is not affected by this update. The launch-screen storyboard appears before the Unity Splash Screen (if you have enabled it)."

    Does this mean that I don't need to do anything? I'm on a Personal license, and the only splash/launch screen I have is Unity's built-in splash screen. Like when you launch my app, you'll see Unity's built-in splash screen, followed by the app's home menu. Thanks!
     
  39. Moonjump

    Moonjump

    Joined:
    Apr 15, 2010
    Posts:
    2,398
    It is really strange if you have nothing before the Unity splash screen. Does the screen go black for a while? That is what happens if you haven't populated the launch screen at all. That screen is what is changing.
     
  40. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,406
    we're on it
     
    Numa and tessellation like this.
  41. tessellation

    tessellation

    Joined:
    Aug 11, 2015
    Posts:
    237
    It's so satisfying to hear this from a Unity employee. You guys should just reply with this to every post on the forums. It's a good job for a bot maybe. Wait, are you a bot? LOL.
     
  42. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    7,065
    Is there no way for Unity to automate this part? After doing it for a few thousand times, it's gotten pretty old. That and having to edit the languages, because Unity keeps adding "English" instead of something valid like "en" as development language, makes building for iOS 10 times more annoying than it could be.
     
  43. tessellation

    tessellation

    Joined:
    Aug 11, 2015
    Posts:
    237
    If you Google search how to add a PostProcessBuild callback to Unity, you can add your own script to copy the LaunchImages that are used by your storyboard (example code below). Although it's undocumented, Unity 2018.4+ may attempt to copy images in the same folder as the storyboard. I only mention this because I *do* copy xcassets images in PostProcessBuild and I get warnings from Unity about it not being able to find storyboard-referenced images in the storyboard folder.

    Code (CSharp):
    1. string pathToPBX = path + "/Unity-iPhone.xcodeproj/project.pbxproj";
    2. PBXProject proj = new PBXProject();
    3. proj.ReadFromFile(pathToPBX);
    4. string target = proj.TargetGuidByName("Unity-iPhone");
    5.  
    6. // Add xcassets needed for storyboard
    7. CopyFolderRecursive(Application.dataPath + "/UI/Application/iOS/LaunchImages.xcassets", path);
    8. string guidXCASSETS = proj.AddFile("LaunchImages.xcassets", "LaunchImages.xcassets");
    9. proj.AddFileToBuild(target, guidXCASSETS);
    10.  
    11. proj.WriteToFile(pathToPBX);
     
    AcidArrow likes this.
  44. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    7,065
    I mean, the splash image does get copied to Data/Raw the problem is it getting added to bundle resources.
     
  45. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,406
    Upon investigation it seems to happen ONLY if you use custom storyboard. On 2020.2 it will be not an issue (as we have revamped UI to get rid of the checkbox, and now custom storyboard is yet another option in the dropdown and is handled "properly"). We will make special fix for 2018,2019,2020.1
     
  46. kaarloew

    kaarloew

    Joined:
    Nov 1, 2018
    Posts:
    197
    If you want to automate this step then
    Code (CSharp):
    1.  
    2. [PostProcessBuild]
    3. public static void ChangeXcodePlist(BuildTarget buildTarget, string path)
    4. {
    5.     if (buildTarget == BuildTarget.iOS)
    6.     {
    7.         // Add splash.png to Copy Bundle Resources
    8.         string projPath = PBXProject.GetPBXProjectPath(path);
    9.         PBXProject pBXProject = new PBXProject();
    10.         pBXProject.ReadFromString(File.ReadAllText(projPath));
    11.         string targetGuid = pBXProject.GetUnityMainTargetGuid();
    12.         string resourcesBuildPhase = pBXProject.GetResourcesBuildPhaseByTarget(targetGuid);
    13.         string imagePath = "Data/Raw/splash.png";
    14.         string resourcesFilesGuid = pBXProject.AddFile(imagePath, imagePath, PBXSourceTree.Source);
    15.         pBXProject.AddFileToBuildSection(targetGuid, resourcesBuildPhase, resourcesFilesGuid);
    16.         File.WriteAllText(projPath, pBXProject.WriteToString());
    17.     }
    18. }
    19.  
     
    zack_sunblink likes this.
  47. tessellation

    tessellation

    Joined:
    Aug 11, 2015
    Posts:
    237
    What's the special fix? Hopefully setting the plist UILaunchStoryboardName to "LaunchScreen" not "LaunchScreen.storyboard"
     
    Numa likes this.
unityunity