2

I have a universal iOS app that is using a custom URL scheme to be launched from external apps.

I also have different launch images, one set for the standard launch and another set for the url scheme launch.

The app has been developed for iOS 7 and older, so I am using xcassets to set the launch images. I have set one catalog for the standard launch images and another one for the url scheme launch images.

How do I specify that the url scheme launch images are to be launched for that specific URL scheme? I am using the

<basename>-<url_scheme><scale_modifier><device_modifier>.png 

name convention and yet it seems not to work, the standard launch image is always shown.

Is that name convention a correct way to name the images when using xcassets?

anavarroma
  • 1,382
  • 1
  • 12
  • 29

1 Answers1

2

Ok, so apparently the assets catalog are only useful to specify the standard launch image (user taps on the home screen button).

When you want to specify different launch images for custom url schemes on your app you still need to stick to the old naming convention.

For example, if I want to specify launch images for the custom url scheme "myscheme" I need to use the following naming convention, even though I'm already using assets catalog (.xcassets file) for the standard launch image:

  • Default-myscheme~iphone.png --> for no Retina Display 3,5'' iPhones
  • Default-myscheme@2x~iphone.png --> for Retina Display 3.5'' iPhones
  • Default-myscheme-568h@2x~iphone.png --> for Retina Display 4'' iPhones
  • Default-myscheme-Portrait~ipad.png --> for no Retina Display iPads in portrait
  • Default-myscheme-Portrait@2x~ipad.png --> for Retina Display iPads in portrait
  • Default-myscheme-Landscape~ipad.png --> for no Retina Display iPads in landscape
  • Default-myscheme-Landscape@2x~ipad.png --> for Retina Display iPads in landscape

These files need to be in the app bundle in order to be found for the system when launching the app.

anavarroma
  • 1,382
  • 1
  • 12
  • 29
  • 2
    I wasn't able to get this working on iOS 8. It was suggested here: http://stackoverflow.com/questions/29656434/launch-image-for-custom-url-storyboard-or-asset-catalog that this may no longer be supported in the latest versions of iOS, can anyone confirm this? – Jonathan Ellis May 09 '15 at 22:41
  • 1
    Cannot get this to work on neither iPad 4 iOS7 or iPhone6Plus iOS9 – bobmoff Mar 15 '16 at 11:30
  • I wasn't able to get this to work on iPhone6 iOS 9, using Xcode 7.3.1. The same project used to work prior to iOS7. I even updated the bundle to include Default-myscheme-568h@2x.png and Default-myscheme-667h@2x.png. What's strange is that Apple's current documentation says it should work - see the section"Displaying a Custom Launch Image When a URL is Opened" at [link](https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/Inter-AppCommunication/Inter-AppCommunication.html#//apple_ref/doc/uid/TP40007072-CH6-SW18) – LWixson Aug 25 '16 at 17:06