Alternate App icons for iPad Part 2
If you have read my previous message about alternate iPad icons everything in there appeared to be correct and will get you most of the way. I suspect though that others and myself have missed something which the App Store process is now flagging.
When you are submitting apps to Test Flight and get one of those “we found a problem” emails with something like this:
ITMS-90892: Missing recommended icon - The bundle does not contain an alternate app icon for iPad of exactly '152x152' pixels, in .png format for iOS versions >= 10.0. To support older operating systems, the icon may be required in the bundle outside of an asset catalog. Make sure the Info.plist file includes appropriate entries referencing the file. See https://developer.apple.com/documentation/bundleresources/informationpropertylist/cfbundleicons
This is just pointing out the obvious. You need to have 3 icons to support the iPad.
The full list of icons you will need now are:
iPad
- iPad-app.png (76x76 px)
- iPad-app@2x.png (152x152 px)
- iPad-pro@2x .png(167x167 px)
iPhone
- iPhone-app@2x.png (120x120 px)
- iPhone-app@3x.png (180x180 px)
When you create these use unique names when you have more than one alternate icon. Then inside your Info.plist
file you’ll want something like this:
<key>CFBundleIcons</key>
<dict>
<key>CFBundleAlternateIcons</key>
<dict>
<!-- icon's directory -->
<key>MyCustomIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<!-- filename minus extension and size info -->
<string>MyCustomIcon-iPhone-app</string>
</array>
</dict>
</dict>
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string></string>
</array>
<key>CFBundleIconName</key>
<string></string>
<key>UIPrerenderedIcon</key>
<false/>
</dict>
</dict>
<key>CFBundleIcons~ipad</key>
<dict>
<key>CFBundleAlternateIcons</key>
<dict>
<!-- icon's directory -->
<key>MyCustomIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<!-- filename minus extension and size info -->
<string>MyCustomIcon-iPad-app</string>
<string>MyCustomIcon-iPad-pro</string>
</array>
</dict>
</dict>
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string></string>
</array>
<key>CFBundleIconName</key>
<string></string>
<key>UIPrerenderedIcon</key>
<false/>
</dict>
</dict>
That should give you what you want. If you want to then display the icon as a choice you might want to choose the iPhone 2X icon and do something like this. ImageFromResource(resourceName: “MyCustomIcon-iPhone-app@2x").cornerRadius(10)
and that sorts out everything for displaying the icon. See the “part one” mentioned above or go directly to Steven Troughton Smith’s github repo if you’re not sure how to set the icon.