Search code examples
iosiconsinfo.plistfile-association

Is CFBundleTypeIconFile array mandatory for adding custom file type support on iOS app?


Is CFBundleTypeIconFile array mandatory for adding custom file type support on iOS app? I've found different information on iOS SDK help.

We see here that the CFBundleTypeIconFile array is mandatory:

The entry for each document type should contain the following keys:

CFBundleTypeIconFile
CFBundleTypeName
CFBundleTypeRole

In addition to these keys, it must contain at least one of the following keys:

LSItemContentTypes
CFBundleTypeExtensions
CFBundleTypeMIMETypes
CFBundleTypeOSTypes

https://developer.apple.com/library/ios/documentation/general/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/TP40009249-SW9

And here we can read that the CFBundleTypeIconFile array is not mandatory:

Each dictionary in the CFBundleDocumentTypes array can include the following keys:

CFBundleTypeName specifies the name of the document type.
CFBundleTypeIconFiles is an array of filenames for the image resources to use as the document’s icon.
LSItemContentTypes contains an array of strings with the UTI types that represent the supported file types in this group.
LSHandlerRank describes whether this application owns the document type or is merely able to open it.

https://developer.apple.com/library/ios/documentation/FileManagement/Conceptual/DocumentInteraction_TopicsForIOS/Articles/RegisteringtheFileTypesYourAppSupports.html#//apple_ref/doc/uid/TP40010411-SW1

Where is the truth? Can I use the empty array? I just don't want to specify custom images for files to use app icon by default.


Solution

  • File icons look fine without special icons inside the bandle.